22 June, 2014
Learning Swift
Here are the links to download free Swift Programming Guide from iBooks Store.
- The Swift Programming Language
- Using Swift with Cocoa and Objective-C
18 June, 2014
Swift is the future
Apple announced Swift in WWDC 2014. Although you can combine Swift and Objective-C in one app. Swift is the future of Apple developer. Swift is more safe, more efficient, more easy to write and read.
In this blog, I will focus more in Swift, including how Swift works, how Swift combine Objective-C, etc. Stay Tuned :D
In this blog, I will focus more in Swift, including how Swift works, how Swift combine Objective-C, etc. Stay Tuned :D
14 May, 2014
AdMob SDK 6.9.2
Google has just released AdMob SDK 6.9.2. In this version google utilized IDFA API. When you submit app with AdMob SDK 6.9.2, you have to tell apple you are using IDFA in your app, otherwise, your binary will be rejected.
14 April, 2014
How to check where is the exception thrown
Sometimes when the exception thrown. Xcode just shows the memory status, but not exactly the line of code. If you want to see where is the exception thrown. You can add a exception breakpoint.
1. click the breakpoint tap on the left side navigators window.
2. on the left bottom, click the + button and then click "Add Exception Breakpoint".
3. now, when exception is thrown, Xcode will show which code has a problem.
1. click the breakpoint tap on the left side navigators window.
2. on the left bottom, click the + button and then click "Add Exception Breakpoint".
3. now, when exception is thrown, Xcode will show which code has a problem.
11 April, 2014
Call URL: tel vs telprompt
Both tel: and telprompt: can make a phone call. But what is the difference?
For tel:, iPhone will make the call immediately and will state in Phone app after the call.
For telprompt:, iPhone will ask whether you want call this number and will return to your app after the call.
Be aware that sometimes address book returns the phone number with white space or non-break space. It causes the NSURL returns null. The following code can filter out these 2 types of space.
NSString *phoneNumberString = [[self.tableView.detailTextLabel.text componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
For tel:, iPhone will make the call immediately and will state in Phone app after the call.
For telprompt:, iPhone will ask whether you want call this number and will return to your app after the call.
Be aware that sometimes address book returns the phone number with white space or non-break space. It causes the NSURL returns null. The following code can filter out these 2 types of space.
NSString *phoneNumberString = [[self.tableView.detailTextLabel.text componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
07 March, 2014
Simple way to create NSString & NSArray
There are several ways available to create NSString & NSArray, but sometimes you may think those methods are too long that decreases the readability of your code. Here are 2 simple ways to create NSString and NSArray.
NSString *string1 = @"string1";
NSString *string2 = @"string2";
NSArray *array = @[string1, string2];
NSString *string1 = @"string1";
NSString *string2 = @"string2";
NSArray *array = @[string1, string2];
06 February, 2014
Problem of declaring CF Object as property in NS Object
Error message when analyze: incorrect decrement of the reference count of an object that is not owned
If the CF Object is declared as a property in a NS Object, the compiler is not able to determine whether the property is still being referencing by other method. In my case, I declared ABAddressBookRef as a property in a NS Object.
@interface AddressBookManager : NSObject
@property ABAddressBookRef addressBook;
The problem has been solved by changing property to instance variable
@interface AddressBookManager : NSObject {
ABAddressBookRef addressBook;
}
If the CF Object is declared as a property in a NS Object, the compiler is not able to determine whether the property is still being referencing by other method. In my case, I declared ABAddressBookRef as a property in a NS Object.
@interface AddressBookManager : NSObject
@property ABAddressBookRef addressBook;
The problem has been solved by changing property to instance variable
@interface AddressBookManager : NSObject {
ABAddressBookRef addressBook;
}
Subscribe to:
Posts (Atom)



