MJC 澳門賽馬會所

澳門賽馬會所
澳門賽馬會所 (iPhone 版) 是澳門賽馬會會所專為 iPhone 手機用戶推出的手機應用程式。

主要功能包括:

√新進商品:
包括最新推出的產品資料,特惠,及相關訊息。

√商品櫥窗:
用戶可透過手機查看所有本司的產品資訊以及相關參數。
也可按分類搜查。
並可隨時瀏覽高清產品圖片。
另外可分享至外部網站。

√據點總覽:
瀏覽公司位置、地址及電話等資訊,亦可以地圖方便查詢。

√我的收藏:
瀏覽過的產品可加入我的收藏儲存在此,方便紀錄與翻看。

√關於我們:
澳門賽馬會所的歷史沿革、服務內容、以及進一步的資訊。

MJC Dining (iPhone) is the app of MJC Dining especially developed for iPhone users.

Features include:

News
¡´ Announcements of new arrivals, promotions, and other information updates.

Products
¡´ View detailed product information including specifications of the full product range of MJC Dining
¡´ Search for products by categories.
¡´ Superb quality high resolution product images
¡´ Share products to social networks.

Stores
¡´ Find office locations, with contact details including address and phone number, and display of office locations via Map.

Wish List
¡´ Save products for reviewing at a later time

About Us
Company profile of MJC, including company history, business description, and contact details including corporate website address.

廣告
已加上的標籤 , ,

Object-c 放大縮小圖片


- (UIImage *)reSizeImage:(UIImage *)image toSize:(CGSize)reSize
{
UIGraphicsBeginImageContext(CGSizeMake(reSize.width, reSize.height));
[image drawInRect:CGRectMake(0, 0, reSize.width, reSize.height)];
UIImage *reSizeImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return reSizeImage;
}

已加上的標籤

Target Integrity Provisioning profile is expiring

最近無緣無故會出現這個問題,
在xcode->window->organizer裡面Provisioning Profiles多了一些以前的舊憑證
把其他用不到的憑證刪除即可解決此問題

已加上的標籤

UISegmentedControl 文字大小

以下方式僅限ios 5以上版本

ex:


viewController.h

@property (nonatomic, strong) UISegmentedControl *segControl;

viewController.m
@synthesize segControl;
NSArray *items = [NSArray arrayWithObjects:@"apple", @"banana", @"orange", nil];
self.segControl = [[UISegmentedControl alloc] initWithItems:items];
self.segControl.frame = CGRectMake(0, 0, 300.0f, 40.0f);
[self.segControl addTarget:self action:@selector(pickOne:) forControlEvents:UIControlEventValueChanged];
self.segControl.segmentedControlStyle = UISegmentedControlStyleBar;
self.segControl.tintColor = [UIColor colorWithRed:1.000 green:0.000 blue:0.012 alpha:1.000];
self.segControl.selectedSegmentIndex = 0;

#ifdef __IPHONE_5_0
UIFont *font = [UIFont boldSystemFontOfSize:16.0f];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font
forKey:UITextAttributeFont];
[self.segControl setTitleTextAttributes:attributes
forState:UIControlStateNormal];
#endif
self.navigationItem.titleView = self.segControl;

 

已加上的標籤

IPhone 判斷網路連接

最近在開始學習寫IPhone軟體, 判斷網路連線部分, 參考過官方sample code Reachability,在xcode4.2上面由於我原本專案有使用了Apple LLVM compiler 3.0, 所以在調用官方sample code時設定一直有問題, 爬過Google後有發現有其他方式可以判斷, 參考網址轉載如下:http://blog.csdn.net/favormm/article/details/5352656

開發環境 Mac OS X 10.6.8, Xcode 4.2 首先,

添加framework (SystemConfiguration, libz.1.1.3.dylib)至專案

接下來新增檔案(command + n), 選擇Cocoa Touch -> Objective-C class -> NSObject -> 檔案名稱(這裡將檔案名稱命名為Connect), 接下來在Connect.h中, 修改程式碼如下

Connect.h
 #import<Foundation/Foundation.h>
#import<SystemConfiguration/SystemConfiguration.h>
#import<netinet/in.h>
#import<arpa/inet.h>
#import<netdb.h>
@interface Connection : NSObject
+ (BOOL)isConnected;
@end

Connect.m
#import "Connection.h"
@implementation Connection
+ (BOOL)isConnected{
// Create zero addy struct
sockaddr_in zeroAddress;
bzero(&zeroAddress, sizeof(zeroAddress));
zeroAddress.sin_len = sizeof(zeroAddress);
zeroAddress.sin_family = AF_INET;
// Recover reachability flags
SCNetworkReachabilityRef defaultRouteReachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress);
SCNetworkReachabilityFlags flags;
BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags);
CFRelease(defaultRouteReachability);
if (!didRetrieveFlags) {
NSLog(@"Error. Could not recover network reachability flags");
return NO;
}
BOOL isReachable = flags &
kSCNetworkFlagsReachable;
BOOL needsConnection = flags &
kSCNetworkFlagsConnectionRequired;
BOOL nonWiFi = flags &
kSCNetworkReachabilityFlagsTransientConnection;
NSURL *testURL = [NSURL URLWithString:@"http://www.google.com/"];
NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0]; NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:self];
//[[[NSURLConnection alloc] initWithRequest:testRequest delegate:self] autorelease]; return ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO; }
@end

接下來在欲調用此程式function, 記得 #import “Connection.h" 並且在調用的地方撰寫如下
ex: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization if ([Connection isConnected]) {...} else{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"連線錯誤" message:@"無法連結網路! 請關閉飛航模式或至設定確認您已開啟Wi-Fi或是行動網路。" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alertView show]; return nil; } return self; }

已加上的標籤 , ,