iphone-sdk-3.0

How to prevent keyboard changing from Numbers to Alphabet when the space key is touched?

二次信任 提交于 2020-01-02 04:52:08
问题 I have UITextFields on a table to enter values. Some of these fields accept only numbers. I am using UIKeyboardTypeNumbersAndPunctuation for the keyboardType, and shouldChangeCharactersInRange to filter the characters. Also, all the corrections are disabled: textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation; textField.autocorrectionType = UITextAutocorrectionTypeNo; textField.autocapitalizationType = UITextAutocapitalizationTypeNone; On the numeric only fields, when the space key

NSKeyedUnarchiver memory leak issue

爱⌒轻易说出口 提交于 2020-01-01 19:14:13
问题 I have problem with this code, it's working on debug environment. On the instruments I'm seeing memory leak problem on this function, instruments is giving warning that Category Event Type Timestamp Address Size Responsible Library Responsible Caller 27 SocialNetwork Malloc 00:19.951 0x3d64d20 80 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] - (NSMutableArray *)GetDataInstanceToUserDefaults{ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSData

Getting leak in leak in [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil]

こ雲淡風輕ζ 提交于 2020-01-01 07:26:08
问题 I am having a leak in returnData= [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil]; The below is the code i am using NSString* curl = @"https://Some Url?ticket="; curl = [curl stringByAppendingString:self.ticket]; curl = [curl stringByAppendingString:@"&apikey=hjgajgfjaghjf&XMLString="]; curl = [curl stringByAppendingString:stringB]; curl = [curl stringByReplacingOccurrencesOfString:@"\n" withString:@""]; NSURL *finalURL = [NSURL URLWithString:curl];

Core Data and UITabBar Controller - help?

匆匆过客 提交于 2020-01-01 07:06:44
问题 So I have a Project with a UITabBarController and a few Navigation Controllers, and I am trying to implement Core Data. Its just not working. I have a bit of a weird setup: UITabBarController -> Navigation Controller -> Table View Controller I have copied all of the Core Data code and added an entity with an attribute ('Event' and 'name' - just like the tutorials). I keep getting the error: erminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName:

iPhone Obj C — Sorting a Mutable Array of dictionaries — display a string but sort by value

六月ゝ 毕业季﹏ 提交于 2020-01-01 06:37:07
问题 I have a NSMutableArray with 30 dictionaries inside of it. Each contains a name and a value. I currently have the names sorted so that the show in a table view alphabetically. However, I'd like to make a UIButton to give the option of STILL DISPLAYING THE NAMES, but ordered by the value. The value doesn't need to be displayed. Also, where in the .m/.h files would these codes be placed? THANKS! 回答1: To be able to help you I need a test data to work with. Let's say your array with data looks

Group by weekdays with Core Data

百般思念 提交于 2020-01-01 03:43:06
问题 In my Core Data Model i've got an entity that has a date attribute and as the title suggests, i'd like to group this entity by (week)days. The problem is, the dates are stored more or less as timestamps and i don't know how to create a predicate that is capable of grouping/filtering my entities approprioately. I've figured out that i will probably have to do a fetch for each day, so created following method. The code were i need help with is right in the middle of it. -

NSHomeDirectory returns different path each time iPhone App is restarted

心已入冬 提交于 2020-01-01 01:52:09
问题 I noticed that NSHomeDirectory returns a different path each time i restart the App with Xcode, and apparently even if i click the icon manually since it doesn't load the file's contents. I'm stunned that it gives me a different directory each time i restart the app. This happens on both simulator and device and even if i use the "ForUser" method. My calls look like this: NSString* fullPath = [NSHomeDirectory() stringByAppendingPathComponent:@"test.file"]; or NSString* fullPath =

Treasure hunt in Augmented Reality

白昼怎懂夜的黑 提交于 2020-01-01 00:48:34
问题 I'm looking for an augmented reality browser/toolkit/api that supports the following: Adding fixed 3d models such as a treasure-chest. Possible image recognition of this treasure-chest so the iPhone knows when you're looking at it. Specify altitude on a 3d model so it can be positioned on the ground or the second floor in an apartment building for example. It must have support for "migrating" it to a standalone app that can be published on the app store. The ability to customize the camera

how to upload image dynamically on server?

放肆的年华 提交于 2019-12-30 13:23:32
问题 In my application i want to upload the images to server. I am able to upload images on server but the name of the image mention in front of filename=%@.jpg. remains the same for images [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@.jpg\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; but i want to save the image on server with the same image name it has...... plz help me out. following is my code: -(IBAction)upload:(id)sender {

How to set iPhone Wallpaper Programmatically

 ̄綄美尐妖づ 提交于 2019-12-30 11:50:10
问题 I am developing an application in which I have to set image as the iPhone wallpaper (the background image on the "slide to unlock" screen). Do we have any API reference for this. Please help Thanks in advance Parmeswar 回答1: Not presently, the only thing that you can do is save the image to the camera roll and give the user instructions on how to change their wallpaper using the new image. 回答2: NSString *str_mainMenu = [[NSBundle mainBundle] pathForResource:@"Unlock" ofType:@"jpg"]; mainView