Tag: objective c

iphone: Apple ID does not have permission to access iTunes Connect

We have a company account and I have admin rights on it and I am trying to Login into to https://itunesconnect.apple.com but its giving error. Apple ID does not have permission to access iTunes Connect. I can log on to Apple site and have admin rights on our companies account but could not post Application […]

NSDate Min and Max Possible Values

Anyone know what the minimum and maximum possible values are for an NSDate?

Hide navigation bar, but when I transition to the previous view (popped) it shows the old back button temporarily. Why?

I have view controllers in a navigation controller (root: RootViewController, second: ReadingViewController), but in the second view controller I want to disable the navigation bar for a UIToolBar (as I don’t need the title and want more buttons, like in iBooks or the Facebook app). Problem is, when I hide the navigation bar in the […]

Why is this program faster in Python than Objective-C?

I got interested in this small example of an algorithm in Python for looping through a large word list. I am writing a few “tools” that will allow my to slice a Objective-C string or array in a similar fashion as Python. Specifically, this elegant solution caught my attention for executing very quickly and it […]

How to “validate” a NSTimer after invalidating it?

So basically, I have this timer that should be repeated when it receives a key event, and invalidates when the user releases the key. However, I am unable to “validate” the timer back even by calling the addTimer:forMode: in NSRunLoop. Does anyone know why this is happening and how I can fix this? Thanks.

iOS: Mirror content on screen

I would like to know if it is possible to flip the contents of a UIView within the same device; meaning not to an external monitor but on the device itself. I have searched a bit on google, but all I can find is to external screens.

How to represent money in Objective-C / iOS?

I’m working on an iPhone app and want to represent money ($) amounts. I can’t use float because they introduce certain amount of rounding errors. What can I use? I’m thinking of defining my own Money class and store dollars and pennies as NSInteger internally. @interface Money : NSObject { //$10.25 is stored as dollas=10 […]

How to get the value for each key in dictionary in Objective-C?

I’m maintaining a NSMutableDictionary which holds key and value pair.Now i need to perform some operation for each value in it.How to retrive value from dictionary. // this is NSMutableDIctionary NSMutableDictionary *dictobj = [[NSMutableDictionary alloc]init]; // in methodA -(void)methodA { //get the value for each key and peform an operation on it. } How to […]

set UIButton's buttonType programmatically

This question already has an answer here: How do I create a basic UIButton programmatically? 34 answers

How do I add NSDecimalNumbers?

OK this may be the dumb question of the day, but supposing I have a class with : NSDecimalNumber *numOne = [NSDecimalNumber numberWithFloat:1.0]; NSDecimalNumber *numTwo = [NSDecimalNumber numberWithFloat:2.0]; NSDecimalNumber *numThree = [NSDecimalNumber numberWithFloat:3.0]; Why can’t I have a function that adds those numbers: – (NSDecimalNumber *)addThem { return (self.numOne + self.numTwo + self.numThree); } I […]