objective-c

Adding a UIView as a first run view only

I would like to add a Welcome view to my app which describes the instructions etc. I would like this to appear only once when the app is first launched... then with subsequent launches go to my app's main view... which is a navigation controller. What is the best way to track launches/ implement this idea? Thanks. ...

iPhone Core Data: How to copy NSSet from one entity to another?

This code is used to make "initial data" or "test data". The Category entity will carry default types. The Subcategory entity will copy default types from the Category. They wouldn't be using the same types because new or old types may be deleted or added to the Subcategory. -(void)newCat:(NSString*)catName subCat:(NSArray*)subCatN...

Best way to parse a file in Objective-c

Hello everyone. I am trying to parse out an apache-like config file using Objective-c. Where is the best place to start? I haven't done a lot of file read/write on this platform. Thanks! ...

Simple guide to Game Center Integration ?

Hi all, Could anyone point me in the direction of an idiots guide to integrating Game Center into an iPhone app ? Please do not refer me to any Apple documentation as it's about as useful as a pork chop at a barmitzvah. Thanks, Martin ...

how to change the data in HTML table dynamically

i hav a html tags stored in string and i want to load the table with the attributes which i given dynamically through program... how to search the particular tags of the row and column of html and add the data to the attributes... any help appreciated... Thanks in advance...... ...

Change colour Navigation Bars, Tab Bars

how do you change the colour of the Navigation Bars, Tab Bars? Everytime I change it, I dont get the colour I want, It either gradient red, or gradient white/silver. But unable to do it, default gradient blue and grey both look good but try changing it any other colour and it looks terrible. Any tips? how to do gradient? ...

iphone app crashing problem while application running in background mode

hi iam currently working in simple app in which i sends request in friends and call one timer background loop to access my friend response using web services . my application work good but after 10 or 15 minute my application will crash due to some problem . my code for all loop and connection are follows // NSMutableData *web...

not able to present mail compose view controller on the view

i hav a button on navigation bar for opening the mail view controller .. i am using view based app and when i tap the button its executes the ibaction i wrote but not presenting the view .... -(IBAction)mailid:(id)sender{ MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDeleg...

Data encapsulation...?

Would anyone be able to explain to me what data encapsulation in Objective-C is? I've been told that this an important concept of Objective-C but I don't see why... Explain it to me as if I was 5 and then as if I was 25.... Thanks for your time, ~Daniel ...

Making a layer structure for a drawing application

Hi, In relation to question an eralier question of mine, I have tried and failed to create a class with a NSMuttableArray member variable holding CALayerRefs. Can someone please guide me on how to do that. What I want to do is basically create CALayerRefs or CGLayerRefs or whatever, push them into my layers variable, and then, when I nee...

How do I remove a view from a super view without unloading the superview?

I'm trying to something like [view removeFromSuperview] however when I do it appears from what I've seen and what I've read in the apple documentation that the normal behaviour is to remove the superview from view as well (unless I have misread). I'm wondering how to simply remove a view from the superview, i.e. in the case of creating ...

iPhone UITableViewController move only specific rows in a table

I have implemented a standard UITableViewController. I have made only some rows in the table to be moveable, ie. canMoveRowAtIndexPath returns true only for some indexPaths (for rows in the first part of the table). I would like to allow exchange of only those rows that are moveable, ie. for which canMoveRowAtIndexPath returns true. Eg...

How I can open map with MKMapView?

Hi guys. First off, sorry for my english. I have a problem :( I want to open the map of the city. I can use following construction: NSString *opMap = [[NSString alloc] initWithFormat:@"http://maps.google.com/maps?q=new+york+21st+street"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:opMap]]; [opMap release]; But, th...

How do you create a static library in XCode and reference from 3rd party project?

I need to create a new target in project SDKTest.xcodeproj (say target is named lib_SDK.a) which contains all of the files in SDKTest.xcodeproj. I would then like to be able to import the lib_SDK.a file in my third party application called Client.xcodeproj and instanciate objects from that library, say an object called ScanMe.h I am cur...

recorrido de labels con arreglos

Hola tengo este problema declare esto IBOutlet UILabel *h1; IBOutlet UILabel *h2; IBOutlet UILabel *h3; IBOutlet UILabel *h4; y quiero llenar los label con numeros random asi: for (int i=1; i<=4; i++) { int numerosr = random()%12; h[i].text = [[NSString alloc]initWithFormat:@"%2.1f", numerosr]; } pero marca error en h[1] qu...

Determine who is holding onto an object

In Objective-C, is there any way to find out which objects are the ones retaining another object? For example, I have a collection of MyClass objects and if I iterate through them to get the retain count on each object, I see the count at 2. How can I find out who the holders are? for (NSString *aKey in aDictionaryOfMyObjects) { MyC...

Objective C member in C++ class

Hi. Is it possible to have a objective c member in a c++ class @interface ObjectiveCClass : UIViewController { int someVarialbe; } - (void)someFunction; @end class CPlusPlusClass{ ObjectiveCClass obj; // have a objective c member void doSomething(){ obj.someFunction; // and call a objec...

deleteCharactersInRange work something wrong

HI all! I am using message deleteCharactersInRange from NSMutableString. And there is a problem that this finction deletes range in a wrong way. Here is a sample of code that works wrong: -(void) btnClick { NSRange deleteRange = NSMakeRange(0, 1); [valueStr deleteCharactersInRange:deleteRange]; [self ShowNumber]; } I have a mutable str...

NSMutableData object not recognizing selectors?

I'm currently trying to write an iPhone companion to a website that I'm developing. I'm trying to get JSON data from my website by making a controller a delegate of the NSURLConnection. Here's the problem though, I have an NSMutableData object named responseData initialized like so: responseData = [NSMutableData dataWithLength:0]; And...

Reload UITableView conditionally based on SegmentedControl

I would like to reload a table view conditionally based on the value of a segmented control, when a button is tapped. So in my buttonTapped method, i have this code which randomly selects an array item. In the else block i would like to remove the selected item from the array to prevent the same item being selected again, currently I re...