iphone-sdk-3.0

MFMailComposeViewController attachment file size limit

别说谁变了你拦得住时间么 提交于 2019-12-08 05:20:51
问题 I'm using MFMailComposeViewController to send a file. Everything works fine with files under 15mb. Anything over, and the file simply doesn't get attached to the MFMailComposeViewController view. It's not that the email server isn't accepting, its that it never gets attached in the first place. Does anyone have any ideas if there's a way to resolve that? I know many email services can't handle attachments over 5 or 10mb, but other services allow you much larger file size.

iphone - AVAudioRecorder gives mono playback (sound playing in just one channel)

爱⌒轻易说出口 提交于 2019-12-08 05:01:07
问题 I am using AVAudioRecorder to record audio and save to a wav file (using SDK 3.0) The settings dictionary contains the following values NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; [recordSetting setValue :

Centering map against user's location

送分小仙女□ 提交于 2019-12-08 04:37:37
问题 I'd like to center a map (mapkit) against the user's location. I do the following in the simulator but only get a blue map with no content. What steps should I be taking? MKCoordinateRegion region; MKCoordinateSpan span; span.latitudeDelta=0.2; span.longitudeDelta=0.2; CLLocationCoordinate2D location; location.latitude = mapView.userLocation.location.coordinate.latitude; location.longitude = mapView.userLocation.location.coordinate.longitude; region.span=span; region.center=location; [self

Addressbook Save Image for contacts programmatically

风流意气都作罢 提交于 2019-12-08 04:30:22
问题 I am creating an addressbook application in that all the data are stored to server and when User will ask then server will restore all the contacts to iPhone. My problem is how to send Image to server as well as how I will be able to restore the contact Image , I came to know that my server will provide me an Image in base64 encryption format. So can any help me how to perform image saving and retrieving for Addressbook Programmatically 回答1: You need to convert the base64 image in nsdata and

iPhone - how is data transferred in P2P

只谈情不闲聊 提交于 2019-12-08 03:52:37
问题 I am trying to implement a P2P application. What I try to do is transfer a custom NSObject class's data between the devices. I am not able to figure out when the "receivedData" method is invoked by GKSession. Here's what I've done The usual connection and showing a dialog box with peers When the app receives a state change for a peer and the state is Connected, I am sending the data to all peers (ideally this should be called when each peer accepts the connection) using NSCoding methods In

how to avoid dots next to a uitextfield

邮差的信 提交于 2019-12-08 03:51:19
问题 Is that possible to remove the dots which are displayed next to uitextfield when text is larger than the width of the uitextfield. 回答1: There is a property lineBreakMode which defines the behaviour when the text to be displayed is larger than the box of the control //UILineBreakMode //Options for wrapping and truncating text. typedef enum { UILineBreakModeWordWrap = 0, UILineBreakModeCharacterWrap, UILineBreakModeClip, UILineBreakModeHeadTruncation, UILineBreakModeTailTruncation,

how to get objects from a json array in iphone?

守給你的承諾、 提交于 2019-12-08 03:51:08
问题 I am working on an iPhone app which involves using json-framework.I am getting array using NSURL [{"firstName":"X","lastName":"Y","id":1},{"firstName":"A","lastName":"B","id":2}] How can i get these 2 objects as like if i query for id=1, the O/P is id=1 firstName:X lastName:Y and putting it in a table. I am googling the stuff from many days but didn't get any solution. Please help me out , explanation through code is appreciated. Thank You. 回答1: If your target SDK is ios4 or higher, you can

CoreAudio - how to determine the end of the playing aac file

僤鯓⒐⒋嵵緔 提交于 2019-12-08 02:01:06
问题 I am playing with CoreAudio on the iPhone, and I am unable to find how to know when the song has finished to play. I put a property listener on kAudioQueueProperty_IsRunning , it is working when starting playing but not at the end of the file. It's work when I stop AudioQueue... Do you have an idea ? Thanks a lot. PS : I am using sample code from the excellent book iPhone Cool Projects : http://apress.com/book/downloadfile/4453 Edit : there’s a bug in the code that went out with the book. The

Has anyone used Buzz Andersen's Simple iPhone Keychain code?

隐身守侯 提交于 2019-12-08 01:54:56
问题 You can find it here. I'm trying to understand his sample code in order to write a simple program with that stores passwords into the keychain and retrieves them for login. Has anyone done this before? It would be most appreciated if I can see any examples you may have. 回答1: There's really no code to demonstrate, he lists both calls there. Heres's an example, for what it is worth: NSError *error; [SFHFKeychainUtils storeUsername:@"fred" andPassword:@"mypassword123" forServiceName:@"myService"

Fire a method ever 24 hours

我怕爱的太早我们不能终老 提交于 2019-12-08 01:38:31
问题 I am trying to fire a method once a day at a given time. I've tried a few things but I can't really make it work. any advice would be appreciated. Also, it would be ideal if it would fire regardless of if the app is open or not. Is this possible? 回答1: UILocalNotification will let you fire a notification (but not a method) when your app is running in the background, or will call a delegate method you implement (application:didReceiveLocalNotification:) if the app is running in the foreground,