iphone-sdk-3.0

Center UIPickerView Text

﹥>﹥吖頭↗ 提交于 2019-12-18 11:06:44
问题 So I have a uipickerview with rows that only contain the number 0-24 and it looks a bit silly since the numbers are left aligned leaving a huge gap on the right of the pickerview. Is there an easy way to center align text in a uipickerview? 回答1: - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 37)]; label.text = [NSString

compare two arrays and get the common items

放肆的年华 提交于 2019-12-18 10:58:19
问题 I have two arrays, but they have different lengths . I want to compare these two arrays and put common items to a new array . meanwhile there should not be have duplicate items is the third array. I really mess up with this, please give me a help. highly thankful . . . 回答1: Something like this? NSMutableSet* set1 = [NSMutableSet setWithArray:array1]; NSMutableSet* set2 = [NSMutableSet setWithArray:array2]; [set1 intersectSet:set2]; //this will give you only the obejcts that are in both sets

obtaining the rotation and size of a UIImageView based on its transformation matrices

*爱你&永不变心* 提交于 2019-12-18 10:58:11
问题 If I have the original transform matrix of a rectangular UIImageView and this image is scaled and rotated and by the end I can read the final transform matrix of this same view, how can I calculate how much the image scaled and rotated? I suppose that somehow these matrix contain these two informations. The problem is how to extract it... any clues? thanks for any help. 回答1: A little bit of matrix algebra and trigonometric identities can help you solve this. We'll work forward to generate a

What iPhone OS APIs could I use to implement a transition animation similar to the iBook page flip transition?

China☆狼群 提交于 2019-12-18 10:46:33
问题 I'm building an iPad app that will have multiple paper pages and I'd like to implement a page transition effect that is similar to the animation you see when you turn pages in the iBooks app on the iPad. A few questions... Is that animation readily available somewhere in the UIKit API or would I have to implement it myself? If I have to implement it myself, what's a good approach or API I should look into? It definitely has a 3D feel to it, could they be using the OpenGL ES API for that? 回答1:

Uplooad Video facebook-ios-sdk : uploaded but not shown on my FB Wall and in My Video

懵懂的女人 提交于 2019-12-18 07:11:12
问题 I have upload the video on facebook using following code Help From : https://github.com/zoul/facebook-ios-sdk/ Full Discussion on Stackoverflow : Facebook iOS Upload Video "Unable to retrieve session key from the access token." Code FBVideoUpload *upload = [[FBVideoUpload alloc] init]; upload.accessToken = facebookObj.accessToken; upload.apiKey = fbAppKey; upload.appSecret = fbAppSecret; NSString *filePath = @"/Users/pratgupta/Library/Application Support/iPhone Simulator/4.1/Media/DCIM

Error Using PHP for iPhone APNS

拜拜、爱过 提交于 2019-12-18 07:01:18
问题 I have been getting this error messages from my PHP code used to send message to the APNS...has anyone got faced the same issue? Warning: stream_socket_client() [function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages: error:14094410:SSL routines: SSL3_READ_BYTES:sslv3 alert handshake failure in /Library/WebServer/Documents/anish/apns/2.php on line 8 Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /Library/WebServer

How do I pick and record video using UIImagePickerController for iPhone?

纵然是瞬间 提交于 2019-12-18 05:22:07
问题 I want to pick a video from iPhone for my application for uploading on the Web. I am using the UIImagePickerController for it. For for opening picker UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil]; [self presentModalViewController:imagePicker animated:YES]; It opens the

Set First Responder in MFMailComposeViewController?

◇◆丶佛笑我妖孽 提交于 2019-12-18 04:59:15
问题 I'm using Apple's MailComposer example application to send email from within my application (OS 3.0 functionality). Is it possible to set the To, Subject, or Body fields as first responder with MFMailComposeViewController? In other words, the behavior would be: the user presses a button which presents the mail view (presentModalViewController). When the mail view is presented, the cursor is placed in one of the fields and the keyboard opens. I notice the MFMailComposeViewController

iPhone sdk - open app store to specific app?

喜欢而已 提交于 2019-12-18 03:55:18
问题 Is there a way to open the app store to a specific application? I tried using something like the following: [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284417350&mt=8&uo=6"]]; But got the following: "Safari cannot open the page because to many redirects occurred". 回答1: Apparently this issue only affects the simulator. A build an go on the device works perfect. 回答2: Use http://itunes.com/app

How can I get the real time in iPhone, not the time set by user in Settings?

…衆ロ難τιáo~ 提交于 2019-12-18 03:40:36
问题 I need to ensure that my app gets the correct time, not the time set by the user in settings. So for instance, once the user starts the app, I'd want to get a timestamp. The user would see the elapsed time on a timer on screen updated every second. When the user exits the app, and after some time restarts the app , the timer would just get the current time and compare it with the original timestamp it kept. So basically, just like the stopwatch in the Clock.App on iPhone. Now the problem with