objective-c

XCode PCH Errors

From what I can tell, this has not been asked before. I am building a cocoa touch static library and I have been going along fine until yesterday, right after I checked the project into SVN, it no longer builds and I have 36 errors in my PCH. This is all my PCH is, and I have found no problems with it in the past: // // Prefix header fo...

How to open an existing project on button click

Hi to all, I am creating a game named space invaders in opengl. i am creating a windows based application.i have imported my existing space invaders project which does not have any .xib into this windows based application. in this application i have one .xib .In this .xib i have one button. when i click on this button i want my existing...

Building Constructors for RPG game in Objective C

I have a character model class which has this structure: @interface CharacterModel : NSObject { // parent of this character CharacterModel *parentChar; // basic details NSString *fname, *sname, *nick; NSString *char_type; // categories of characters: dwarf, etc // health int health; // cash double...

How to capture application inactivity Time in iphone

In my application i want to set inactivity timeout (IdleTime). How can i set this? Is there any way to monitor all events in myappdelegate? For eg i have two UIViewController classes. when i click one control in UIViewController1 or UIViewController2 it should be monitored by myappdelegate ...

how to convert NSinteger to String.

Hi I want to convet int to string in objective c how to do that. my code. for (i=0; i<=200; i=i+10) { // here i want to convet the value of i into string how to do this } Thanks in Advance. ...

ViewForAnnotation is not being called

Hi, I am trying to make a map, where I can see my current location, and see what the street is called. so far, I am able to put a pin on my map, but for some reason, I am not getting the callout. and I have put a NSLog in my viewForAnnotation method, but it is not being called, so i wasn't able to test it. can someone help me? -(void...

showing opengles page through window based project

Hi to all, hello I have the game project which is create on the opengles application .And I have some page which I have to display starting of the game on button action .How can I do this .can I create window base application for for button action to call game loop which create on the opengles .Can it pssible to do that .If yes how can ...

NSXMLParser Entity Problem

I have a .NET web service that is returning the following: <ArrayOfAddressLocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"&gt; <AddressLocation> <AddressLocationId>0</AddressLocationId> <SubscribedCount>0</SubscribedCount> <City>Flor...

How to know if a number is larger then the maximum value in iphone objective-c

A read some posts here and google and don´t find a substancial answer. Supose I have a largest number and I have to assing to a variable. The problem raise when I have a GUI where the user will enter the number. How I can´t know what the value the user will put in a field (let´s think in a UItextField), when I get the number and then ass...

simply add a row to tableview

NSString *ref = [item stringByMatching:myregex1 capture:2]; NSString *value = [item stringByMatching:myregex1 capture:3]; I simply need to add this to my orderTable uitableview, how the hell do i do it:P. i cannot find a simple way of doing this please help :) i would like it to be in the uitableview like this (@"%@ :: %@", ref, valu...

Objective-C: Facebook username from link returned by Graph API call

Fetching http://graph.facebook.com/514417 from the Facebook Graph API gives me the NSString @"http://www.facebook.com/mattdipasquale". How do I extract just mattdipasquale every time? Can I assume the link will be the same format every time? In that case, I could just do: NSString *fbUsername = [[result valueForKey:@"link"] substringFro...

Cocoa alternative for Carbon events for global hotkeys

I just read this article on how to create global hotkeys using Carbon events. In the comments the author mentioned, that he wouldn't probably use this technology anymore because it's the 'way to deprecation'. So far, so good. Now I'm looking for the Cocoa pendant. Does anyone have a hint where to search for it? I tried to google it for ...

How can I copy a link to the pasteboard when the link is included in the tweet?

It tries to make the twitter application program from iphone. MgTwitterEngine is used. How can I copy a link to the pasteboard when the link is included in the tweet? ...

CoreText mapping characters

I have some in a touch handler which responds to a tap on a view that I've drawn some attributed text in. through this, I've got to the point where I have a CTRunRef (and the associated line) as well as the number of glyphs in that run. What I'm not able to figure out easily, is how I can take that run of glyphs and, given my attributed...

Restoring a BOOL inside an NSDictionary from a plist file

I have a plist file which contains an array of dictionaries. Here is one of them: Fred Dictionary Name Fred isMale [box is checked] So now I am initializing my Person object with the dictionary I read from the plist file: -(id) initWithDictionary: (NSDictionary *) dictionary { if (self = [super init]) self.name =...

How to call a method once the MKMapView delegate methods completed

Hi all, I am implementing a MKMapView based application. In that I need to call a method once the pins are displayed. Is there a method to know the delegate methods are completed and we can make our calls?, can you guys please suggest me on this? Thanks in Advance, Sekhar Bethalam. ...

Unit test project failing due to reference issues

I have a unit test to test one of my model classes and I get the follow error when I try building unit test target: "_OBJC_CLASS_$_NSMyClass", referenced from: objc-class-ref-to-NSMyClass in LogicTests.o ld: symbol(s) not found collect2: ld returned 1 exit status I have setup my unit tests as Apple recommends i.e. separate targets. D...

Web service controller design issue

I have various UIViewControllers that need data from web services. Is it best to create separate controller classes which the UIViewController's in turn call or keep the code inside the UIViewController? The reason I ask is because with delegation you kind of have to leave some of the connection code in the calling class in this case t...

replace current view with any existing new view

Hi. In short I would like to call a method from a viewSwitchManager class that contains a method which would switch the current view on display to a different view. -(void)replaceView:(UIView*)oldSubView withView:(UIView*)newSubView; I am trying to implement the following: In my project I have 10 views they all have their own .m and...

NSTextField value bound to NSObjectController won't accept text input or changes

Here's what I've done so far: I have created a class that contains an NSNumber. I instantiated this class in my nib by dragging this object in the document window. I brought an NSObjectController into the document window to manage this object. I changed the class and keys in the attributes window. I dragged a connection from this obj...