objective-c

Add a smaller subView with new origin

I can't get my head around this - I know it must be simple.. I'm starting to feel pretty stupid. I have two viewControllers. MainViewController.h/m and LevelsViewController.h/m I want to add a subView from the LevelsViewController class and a view that is built in IB called levelsView. I am calling this from the MainViewController.m fil...

iPhone - Dismiss modal view by a UITabBarController

Hi everyone, I've got into a very strange problem. I created my own UITabBarController to customize it and it works pretty well... except for the modal views. When I dismiss the modal view (present/dismiss from the UITabBarController) with an animation, it waits until the animation did finished and goes to the first controller of the ta...

Textfield being dequeued before textFieldDidEndEditing is called?

I am using a uitableview with a bunch of dynamically created custom cells each with a label and textfield similar to the settings app on the phone. Problem occurs when i have a lot of textfields say 20, the user selects the first textfield, changes its value then scrolls to the end of the table and selects the last textfield to edit. I g...

Problems with makeObjectsPerformSelector inside and outside a class?

A friend and I are creating a card game for the iPhone, and in these early days of the project, I'm developing a Deck class and a Card class to keep up with the cards. I'm wanting to test the shuffle method of the Deck class, but I am not able to show the values of the cards in the Deck class instance. The Deck class has a NSArray of Car...

how did you get into objective C?

how did you get into objective C? I'm trying to learn but every book I pick up is crap, and I can't find any videos (I'm a visual learner too) ...

Are Objective-C initializers allowed to share the same name?

I'm running into an odd issue in Objective-C when I have two classes using initializers of the same name, but differently-typed arguments. For example, let's say I create classes A and B: A.h: #import <Cocoa/Cocoa.h> @interface A : NSObject { } - (id)initWithNum:(float)theNum; @end A.m: #import "A.h" @implementation A - (id)ini...

How do I define constant values of UIColor?

I want to do something like this, but I cannot get a cooperative syntax. static const UIColor *colorNavbar = [UIColor colorWithRed: 197.0/255.0 green: 169.0/255.0 blue: 140.0/255.0 alpha: 1.0]; I suppose that I could define macros, but they are ugly. ...

Get information from WebPage.

I want to set up an app which can get the information from a particular web page. Then i display the value which got from that page to the iPhone user. Detail:In the webpage on server ,there is the schedule for bus time. If the user input origin and terminus then show the user the time information(list on webpage) in a label. That's all...

how to convert byte value into int in objective-c

Hello, Please tell me how to convert bytes to NSInteger/int in objective-c in iPhone programming? ...

how do i access GData api's(get map) in my application in iphone ?

how do i access GData api's(get map) in my application ? hey i tryed to add gdata.framework in my iphone application but it generate error and tell me in iphone how can i use this web service? ...

Can't access annotation property of subclassed uibutton - editted

Below is my original question. I kept investigating and found out that the type of the button I allocate is of type UIButton instead of the subclassed type CustomButton. the capture below is the allocation of the button and connection to target. I break immediately after the allocation and check the button type (po rightButton at the d...

Please help with iPhone Memory & Images, memory usage crashing app

I have an issue with memory usage relating to images and I've searched the docs and watched the videos from cs193p and the iphone dev site on memory mgmt and performance. I've searched online and posted on forums, but I still can't figure it out. The app uses core data and simply lets the user associate text with a picture and stores t...

SingleTap on UIScrollView

Hi, I see many post dealing with the UIScrollView like in the PhotoApp, but I don't really understand them, thats why I want to reopen a post about it and have a simple solution. What I want is to create (without IB) a simple UIViewController who will contain a UIScrollView (inside my scrollView there will be image and the scrollView w...

how to hide some properties using ABPeoplePicker

greetings! when using peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person, a view with all of the contact's information is shown. I've seen apps which only display selected info only (e.g. phone numbers) how can I do this? I only want to display the ...

Where should I init my data?

I am parsing a CSV file when my iphone app loads. This takes a few seconds I would like to throw up a splash screen while this is happening however because I am loading this data from wakeFromNib the splash screen is coming up after I am done. So where should I do this work? ...

I add buttons on scrollview but buttons are not working.

I am new in iphone.I added 10 buttons on the scrollview.Buttons are scroll properly,but only 5 buttons are working last five buttons are not working.please suggest me what i do next. ...

Iphone UITextField only integer

I have a UITextField in my IB and I want to check out if the user entered only numbers (no char)and get the integer value. I get the integer value of the UITextField like that : int integer = [myUITexrtField.text intValue]; When I put a character ( , ; . ) it return me 0 and I don't know how to detect that it is not only numbers. Ho...

By using “editingStyleForRowAtIndexPath” method, “didSelectRowAtIndexPath” method is not called

Hi, the delegate method not called -(void)viewWillAppear:(BOOL)animated { [theTableView setEditing:TRUE animated:TRUE]; } -(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleDelete; } by calling the above the methods i wi...

NSNumberFormatter to display custom labels for 10^n (10000 -> 10k)

I need to display numbers on a plot axis. The values could change but I want to avoid too long numbers that will ruin the readability of the graph. My thought was to group every 3 characters and substitute them with K, M and so on (or a custom character). So: 1 -> 1, 999 -> 999, 1.000 -> 1k, 1.200 -> 1.2k, 1.280 -> 1.2k, 12.800 -> 12.8k,...

handle when callback to a dealloced delegate?

Hi all, I implemented the delegate-callback pattern between two classes without retaining the delegate. But in some cases, the delegate is dealloced. (My case is that I have a ViewController is the delegate object, and when the user press back button to pop that ViewController out of the NavigationController stack) Then the callback m...