cocoa-touch

Google Delegates on Calendar Framework / EventKit

醉酒当歌 提交于 2020-01-03 07:20:12
问题 I have always run with the assumption that Google delegates can be viewed by iCal and the calendar.app, but are not visible to us developers through the calendar framework, or EventKit. Has this changed? 回答1: I have the problem too. Calendars show up twice. Deselect the delegates. A little later everything disappears. Apparently its a problem on google's side. They claim to be "working on it" Check discussion I found the google thread on another apple forum page devoted to the same problem

Does pushViewController retain the controller?

删除回忆录丶 提交于 2020-01-03 07:17:26
问题 I am struggling to find out if pushViewController retains the controller, currently I have the following code (which works) ... ColorController *colorController = [[ColorController alloc] initWithNibName:nibColor bundle:nil]; [[self navigationController] pushViewController:colorController animated:YES]; [colorController release]; but am considering removing the release and adding an autorelease ... ColorController *colorController = [[[ColorController alloc] initWithNibName:nibColor bundle

Can't localize info.plist strings

浪子不回头ぞ 提交于 2020-01-03 07:08:06
问题 I need to localize two keys of info.plist: NSLocationUsageDescription and NSCameraUsageDescription . So I tried to create a new file called InfoPlist.strings and then I localized it, but app always shows strings stored in info.plist file. What's wrong? Official documentation from Information Property List Key Reference Localized values are not stored in the Info.plist file itself. Instead, you store the values for a particular localization in a strings file with the name InfoPlist.strings.

UISlider not animating in iOS7

大城市里の小女人 提交于 2020-01-03 06:44:09
问题 When I switched from iOS 6 to iOS 7 design, I noticed that using the method setValue:animated: no longer animates the sliding process. Has anyone else came across this problem and found a solution? I'll just add some code to show I've done nothing complicated: //Variable declaration IBOutlet UISlider *s; //Connected in the .xib //Button pressed - (IBAction)buttonPressed:(id)sender { [s setValue:1 animated:YES]; } And it jumps straight to 1 after I press the button. 回答1: Backwards compatible

Filtering a large NSArray with NSPredicate

允我心安 提交于 2020-01-03 06:40:10
问题 I have an array containing 170k strings (words in a dictionary), and a string, looking something like "glapplega". I'm trying to extract the word "apple" from the string (with "apple" being a word in the array). I also need to make sure that the extracted word is at least 3 characters. The code I have right now is the following: NSPredicate *wordPredicate = [NSPredicate predicateWithFormat:@"'%@' contains[cd] SELF", string]; NSPredicate *lengthPredicate = [NSPredicate predicateWithFormat:@

Converting NSString to NSDate adds one year in some cases

假如想象 提交于 2020-01-03 06:29:40
问题 I have some issues converting an NSString to NSDate since the end of the year. The code have always worked great before, but it suddenly started to behave wierd... For example 2013-01-05 becomes 2014-01-05 when converted to NSDate. Since it's a whole year it doesn't feel like it's the timezone spooking. It's not doing this with dates from 2012. Does anybody have an idea of what might be wrong? Code: NSString *dateString = postInfo.noteDate; NSString *newDateString = [dateString

Xcode : Number pad with point for comma

房东的猫 提交于 2020-01-03 05:53:10
问题 I have a number pad with done button. But the user can only choose numbers without comma's. So i there a way to have a number pad with donebutton (wich I have) , integreted with punctation , or at least a point for the comma ? Thanks ! ;) 回答1: Your question implies that you're doing to be doing some formatted number. It would then seem like a safe assumption that you're going to be working with a fixed number of decimal places (as it is more common to see a formatted number with a fixed

UIView isn't released. Calling delegate with self, and using UIView commitAnimations adds retain count

蓝咒 提交于 2020-01-03 05:22:11
问题 I have a view that is added as a subview in a viewcontroller. The subview has delegates methods and the viewcontroller is assinged as its delegate. The subview has a animation and calls a delegate method when the animation is finished. The problem is that when the viewcontroller is removed from the view by the navigationcontroller the subview isn't deallocated. Probably because it's release count is >0. When the viewcontroller is removed from view before the subview animation finishes the

How to change shape of an image using iPhone SDK?

久未见 提交于 2020-01-03 05:14:17
问题 I am creating an iPhone app in which I want to give the user the ability to change shape of a given image as shown below. How can I achieve that? Please let me know. 回答1: SPUserResizableView is a user-resizable, user-repositionable UIView subclass. It is modeled after the resizable image view from the Pages iOS app. Any UIView can be provided as the content view for the SPUserResizableView. As the view is respositioned and resized, setFrame: will be called on the content view accordingly.

How to determine if an image is a progressive JPEG (interlaced) in Objective-C

百般思念 提交于 2020-01-03 04:55:23
问题 I need to determine in Objective-C if an image, that needs to be downloaded and shown, is a progressive JPEG. I did some search but didn't find any obvious way. Can you help? 回答1: The JPEG Format contain several markers. The Progressive Markers are \xFF\xC2 \xFF\xDA If you find these in the file, then you're dealing with progressive JPEGs. 回答2: After doing some more research I found some more info on the way it could be done in iOS. Following what I read in Technical Q&A QA1654 - Accessing