objective-c

using NSStepper control, I am able to click after max and then have to decrement same number of clicks to decrement

Perhaps a confusing title but let me explain the issue through steps: I have a custom style NSStepper control. If I increment up to the point of my setMax the value will reach max as expected. I can then keep clicking increment and the value of course does not increment. However if I wanted to decrement from this point I need to cli...

Having a lot of trouble provisioning my iphone for development

I tried repairing disk permissions to try and get rid of a 100013 error I was getting on a development certificate, left the computer alone for the weekend. When I came back and tried to build my program I got an error : com.apple.tools.product-pkg-utility: error reading property list '/Users/Kevin/Desktop/iProspectLite/Entitlement.plist...

NSNotificationCenter selector not being called

Hi, In my iPad app, in one class I register for a notification: NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(selectedList:) name:@"TTSelectedList" object:nil]; My selectedList: method looks like this: - (void)selectedList:(NSNotification*)notification { NSLog(@"rece...

Making a Cocoa Button look like is pressed, programatically...

The title pretty much says it all, I have some key events, that correspond to buttons also. What property/method to I have to set/call for a button to look depressed (change state?) for say half a second? Thanks alot in advance!! James Hartt ...

static variables in objective-c methods

I want to clarify whether different instances of an Objective-C class share static variables that occur inside methods, or if each instance gets its own copy: - (void) myMethod { static int myVar = 0; } ...

UITableView reloadData duplicates data

I have 3 UITableViews on a UIView in which I load 3 different sets of data from NSMutableArrays. If I call [myTableView reloadData] the data kind of reloads - it actually gets added to the table along with what ever is already there. So 3 calls to reloadData results in triple listed information. How do I prevent this from happening or...

Converting NSString to a decimal

I need to change the code below to make "intAmount" a decimal or an integer (i.e. a person can enter .10 or 1) in my uitextfield. The last line "myProduct" has to be a decimal not an integer and return the product in the format "18.00" for example. Can someone help someone help me alter my code snippit for this? //amt has to be converte...

Touch Gesture on a CALayer

I am doing some drawing on a CALayer and want to be able to have the user single tap different parts of the drawing and trigger a response. I tried looking into gesture recognizers, and it seems that they need to be tied to a UIView. Any idea how I can get my desired behavior using CALayers? ...

Objective C source code method sorting

There are two kinds of programmers in the world: those who like their source code to have all identifiers, methods, etc. sorted and those who think the first kind of programmer are crazy. I am one of those who likes my code to be very organized (for those times I print the code on paper and need to find things). Is there a tool which w...

How to release this object?

I have taken the MailComposer example added to a simple project and under a button I am executing the following code: // display in app email MailComposerViewController *emailClient = [[MailComposerViewController alloc] init]; [self.view addSubview:emailClient.view]; [emailClient showPicker:self]; [emailClient release]; Last line is g...

iPhone Game Center iOS4 support my game? How?

I'm currently building a multiplayer game for the iOS4 and I am trying to understand how I can make it support Game Center when it is released? Is there ANY documentation on it? I can't find it anywhere I'm using cocos2d to build my game and am currently not finished, but would like to be able to code directly in hopes of the game bein...

Getting started with AR on the iPhone: How to position things?

Just starting to play with Augmented Reality on the iPhone ... and I have some questions: How do you position elements on the screen? I assume that it is based on a given longitude, latitude and altitude (but I could be wrong)??? Any solid resources, tutorials, etc... dedicated to building AR type apps for iOS? Thanks much ...

'Card' may not respond to '-fadeAway'

I have a Card class subclassed from UIView and a Deck class from NSObject. Card has a few integer properties on top of the inherited UIView ones and Deck has an NSMutableArray for holding some cards. After generating a deck of cards, I want to display a randomly selected card (by adding it to the superview). Before I do, I check to se...

How can I create a slider/selector in my iPhone app like the Mac OS X dashboard widget slider/selector?

Basically, in my iPhone app, I want to have something almost exactly like the widget slider/selector of the Mac OS X dashboard on the bottom of a view window. Users can slide the row of icons and drag and drop one onto the view. And just like dashboard, the icon animates into something else as the icon is dragged away from the slider/sel...

MPMoviePlayerViewController / MPMoviePlayerController will not play the same movie twice ?!

Steps to replicate: 1. Call playMovieAtURL. Use this url: (http://nov8rixstorage.blob.core.windows.net/searchpad/tutorial_portrait.mov) 2. Let the movie start then press Done. 3. Call playMovieAtURL again using the same URL. Result: MPMoviePlayerViewController animates in; flashes a few times; and closes with error in notification obj...

Memory management when returning an Objective-C object

In Objective-C, if I have a method in which I allocate and initialize an object, then return it, where/how do I release it? for example, let's say I have a method where I create an object: - (void)aMethod { UIView *aView = [self createObject]; } - (UIView *)createObject { UIView *returnView = [[UIView alloc] initWithFrame:CGRe...

How do I Disable a button with an image without reducing the alpha in obejective C?

After creating a round rect button, i disabled the button and the alpha of the button stays at 1 unless i reduced the alpha to 0.5 manually. But after inserting an image to the button, the alpha of the button would be set to 0.5 automatically even after setting the alpha to 1 after disabling the button. I would like to disable the butto...

Displaying a NSCell with the number of children its row has.

I would like a NSCell in an OutlineView to display the number of the children the row it's has. Here's what I mean: What's on the right, but for all rows. How would I go about finding out, first, which row the NSCell is and then from there getting the number of children that row has. ...

Swipe left/right event on ViewController and UITextView over it

I have a ViewController on which there is a UITextView. On swipe let/right i want to refil UITextView with some other text. Touch Events are attached on ViewController. Problem is to pass touch events to ViewController i need to setUserInteractionEnabled to NO. but i set it to No then my UITextView does not scroll content. What shld i d...

i want to show textfield data in tableviewcell which replace the existance data on cell in iphone ?

In my application i hve tableviewcontroller and its detailviewcontroller(dvc). dvc contains textfield and button.I actually want when i clicked on button textfield text is replaced the tableview cell text.what can i do ? explain in detail ...