Tag: ios

[Q&A] Error Itms-90339: This bundle is invalid . The info.plist contains an invalid key ‘CFBundleResourceSpecification’ in app bundle

1. remove

1
CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist

2. modify

1
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication

change

1
2
3
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
                  "--sign", $opt{sign},
                  "--resource-rules=$destApp/ResourceRules.plist");

to

1
2
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",
                  "--sign", $opt{sign});

3. change file permission

1
sudo chown myuser /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/ResourceRules.plist
Tags :

[QA]How to sort NSArray in 3 ways

Compare method

1
2
3
4
5
6
- (NSComparisonResult)compare:(Person *)otherObject {
    return [self.birthDate compare:otherObject.birthDate];
}
 
NSArray *sortedArray;
sortedArray = [drinkDetails sortedArrayUsingSelector:@selector(compare:)];

NSSortDescriptor

1
2
3
4
5
6
NSSortDescriptor *sortDescriptor;
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"birthDate"
                                              ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray *sortedArray;
sortedArray = [drinkDetails sortedArrayUsingDescriptors:sortDescriptors];

Blocks

1
2
3
4
5
6
NSArray *sortedArray;
sortedArray = [drinkDetails sortedArrayUsingComparator:^NSComparisonResult(id a, id b) {
    NSDate *first = [(Person*)a birthDate];
    NSDate *second = [(Person*)b birthDate];
    return [first compare:second];
}];
Tags : ,

[QA] iOS property attributes

Tags :

[QA] How to center the content in UIWebView

Sorry, this entry is only available in 中文.

Tags : ,

[QA] How to chnage iOS left navigationBar title

Read more

Tags : ,

如何使用 #ifdef 判斷 arch

#ifdef TARGET_IPHONE_SIMULATOR

#ifdef TARGET_OS_IPHONE

Tags :

[QA] How to enable c++11 for android and ios

Sorry, this entry is only available in 中文.

Tags : ,

[QA] How to generate json from NSDictionary or NSArray

Sorry, this entry is only available in 中文.

Tags : , , ,

[QA] iOS Device Spec

Resolution and Memory

 

Resolution Memory
iPad 1024-by-768 resolution
at 132 pixels per inch (ppi)
256 MB
iPad mini 1024-by-768 resolution
at 163 pixels per inch (ppi)
512 MB
iPad 2 1024-by-768 resolution
at 132 pixels per inch (ppi)
512 MB
iPad (3rd) 2048-by-1536 resolution
at 264 pixels per inch (ppi)
512 MB
iPad with retina (4th) 2048-by-1536 resolution
at 264 pixels per inch (ppi)
1024 MB
iPhone 480 × 320 px (HVGA)
at 163 ppi
128 MB
iPhone 3G 480 × 320 px (HVGA)
at 163 ppi
128 MB
iPhone 3GS 480 × 320 px (HVGA)
at 163 ppi
512 MB
iPhone 4 960-by-640-pixel resolution
at 326 ppi
512 MB
iPhone 4S 960-by-640-pixel resolution
at 326 ppi
512 MB
iPhone 5 1136-by-640-pixel resolution
at 326 ppi
1024 MB

CPU and GPU power

CPU GPU
iPad Apple A4
(1 GHz ARM Cortex-A8)
PowerVR SGX535
iPad mini Apple A5
(1 GHz dual-core ARM Cortex-A9)
PowerVR SGX543MP2
iPad 2 Apple A5
(1 GHz dual-core ARM Cortex-A9)
PowerVR SGX543MP2
iPad (3rd) Apple A5X
(1 GHz dual-core ARM Cortex-A9)
PowerVR SGX543MP4 (250MHz)
iPad with retina (4th) Apple A6X
(1.4 GHz dual-core Apple Swift)
PowerVR SGX554MP4 (300MHz)
iPhone 620 MHz ARM 1176JZ(F)-S PowerVR MBX Lite 3D (103 MHz)
iPhone 3G 620 MHz ARM 1176JZ(F)-S PowerVR MBX Lite 3D (103 MHz)
iPhone 3GS 883 MHZ ARM Cortex-A8 PowerVR SGX535 (150 MHz)
iPhone 4 Apple A4
(1 GHz ARM Cortex-A8)
PowerVR SGX535

(200 MHz)

iPhone 4S Apple A5
(1 GHz dual-core ARM Cortex-A9)
PowerVR SGX543MP2
iPhone 5 Apple A6
( 1.3GHz Dual-core Apple Swift)
PowerVR SGX543MP3 (333MHz)
Tags :

[QA] How to draw border for UIImage

[QA] How to draw border for UIView

Tags :