Why 100,000 for iOS development <1> and why 100,000 for ios
Master haomeng is devoted to his contribution and respects the author's Labor achievements. Do not repost them.
If the article is helpful to you, you are welcome to donate to the author, support haomeng master, the amount of donation is free, focusing on your mind ^_^
I want to donate: Click to donate
Cocos2d-X source code download: point I send
Game official download: http://dwz.cn/RwTjl
Game video preview: http://dwz.cn/RzHHd
Game Development blog: http://dwz.cn/RzJzI
Game source code transfer: http://dwz.cn/Nret1
1. Set the size of ImagePicker.
ImagePicker is always displayed in the default size in Popover Controller. Setting the popoverContentSize attribute seems useless.
The solution is to "include" ImagePicker to a custom ViewController, and then presentpover the ViewController:
UIViewController * containerController = [[UIViewController alloc] init];
ContainerController. contentSizeForViewInPopover = CGSizeMake (600, self. view. frame. size. height );
[ContainerController. viewaddSubview: _ imagePicker. view];
_ PopController = [[UIPopoverController alloc] initWithContentViewController: containerController];
CGPoint p = [self. view convertPoint: button. center
FromView: sender. superview];
[_ PopController presentpoverfromrect :( CGRect) {p, CGSizeZero}
InView: self. view
PermittedArrowDirections ctions: UIPopoverArrowDirectionAny
Animated: YES];
[_ ImagePicker. view setFrame: containerController. view. frame]; // very important
Note that the width of popover is 600 at most. In addition, _ imagePicker must be init once before each presentPopoverFromRect operation. Otherwise, the display position is incorrect.
2. garbled Chinese file names of uploaded files
The file name is encoded by URL Encode on the iOS client, and then decoded by URL Decode on the server.
Client:
NSStringEncodingenc = NSUTF8StringEncoding;
[Request setData: datawithFileName [filename stringByAddingPercentEscapesUsingEncoding: enc]
AndContentType: @ "application/octet-stream" forKey: key];
Server:
String filename = request. getParameter ("upload_file ");
Filename = URLDecode. decode (s, "UTF-8 ");
3. Mac 64-bit Device
After a project is updated from SVN, Scheme is displayed as a Mac 64-bit Device and cannot run programs.
In this case, you only need to reset the Target's DeploymentTarget (set as a simulator or debugging device ).
4. Remove the NSLog of the debugging program
The Optimize Level of the compilation parameter is set based on different versions.
For example, if the Debug version is None, the Release version is Fastest and Smallest.
In this way, we can redefine the NSLog function based on this parameter:
# Ifndef _ OPTIMIZE __
# Define NSLog (...) NSLog (_ VA_ARGS __)
# Else
# Define NSLog (...){}
# Endif
5. Warning: no previous prototye for function
According to the c Specification, if the function has no parameters, use void as the function parameter.
The function declaration should use "void functionA (void);" instead of "void functionA ();".
6. array sorting
Method 1:
-(NSComparisonResult) compare :( Person *) otherObject {
Return [self. birthDatecompare: otherObject. birthDate];
}
NSArray * sortedArray;
SortedArray = [drinkDetails sortedArrayUsingSelector: @ selector (compare :)];
Method 2:
NSSortDescriptor * sortDescriptor;
SortDescriptor = [[NSSortDescriptor alloc] initWithKey: @ "birthDate"
Ascending: YES] autorelease];
NSArray * sortDescriptors = [NSArray arrayWithObject: sortDescriptor];
NSArray * sortedArray;
SortedArray = [drinkDetails sortedArrayUsingDescriptors: sortDescriptors];
Method 3 (10.6 + ):
NSArray * sortedArray;
SortedArray = [drinkDetails sortedArrayUsingComparator: ^ (id a, id B ){
NSDate * first = [(Person *) a birthDate];
NSDate * second = [(Person *) B birthDate];
Return [firstcompare: second];
}];
7. Where is the build directory of Xcode 4?
Xcode 4 has made many changes. You cannot find the build directory or the Products file group.
So where does it place the executable file generated after project compilation?
The answer is the "{USERNAME}/Library/Developer/Xcode/DerivedData/{PROJECT_NAME_AND_RANDOM_CRAP}/Build/Products/{BUILD_TYPE}/{PROJECT_NAME}. app" directory.
8. Warning: no rule to process file
Xcode tries to detect the type of each file. When it considers the file to be of the "source file" type (for example, A. js file ),
Always try to add it to Compile Sources and try to Compile it.
The solution to this warning is to move these files from the Compile Sources of Build Phases to the Copy Bundle Resources.
9. Warning: 'initwithframe: reuseIdentifier: 'is deprecated
This method will be discarded in later versions. Please use
-InitWithStyle: reuseIdentifier:
10. itms-services does not work
Itms-services is recognized as a special word by apple/iphone. It verifies and installs the certificate specified in provisioning profile.
Verify the profisioning profile before installing the. ipa file. This will connect to "ax.init.itunes.apple.com" and "ocsp.apple.com ".
If you are on the intranet, check whether the above address is accessible.
If not, you will not be able to use OTA to install the application. IOS 4.0 or later is required.
Note: the installation will not be affected if the above address is not accessible. However, iOS will check whether the certificate is valid through the above address at runtime. If the installation is legal, iOS will cache the check results (7 days ).
Master haomeng is devoted to his contribution and respects the author's Labor achievements. Do not repost them.
If the article is helpful to you, you are welcome to donate to the author, support haomeng master, the amount of donation is free, focusing on your mind ^_^
I want to donate: Click to donate
Cocos2d-X source code download: point I send
Game official download: http://dwz.cn/RwTjl
Game video preview: http://dwz.cn/RzHHd
Game Development blog: http://dwz.cn/RzJzI
Game source code transmission:Http://dwz.cn/Nret1