cocoa-touch

Xcode warning: "NSArray may not respond to -addObject"

In my header file, I have this code: @interface TableViewController : UIViewController { IBOutlet UITableView *tblListData; NSArray *arryData; } In my class declaration file, I have this implementation: - (void)viewDidLoad { arryData = [[NSArray alloc] initWithObjects:@"iPhone",@"iPod",@"MacBook",nil]; [super viewDi...

Multiple UILabel or just one?

I have a text which looks like the following, the url of the page is http://www.myurl.com, and the phone # is (999)999-9999, blah blah blah... And I want to show it in a way such that the URL and the phone # are both in different color and bolded. Can I do it using just one UILabel control, or I need to parse them out and put them on...

Difference between addSubview: and insertSubview:atIndex: ?

When adding subviews to a UIView, what's the difference between the methods addView: and insertView:atIndex:? ...

Device debug works but not release

I'm trying to troubleshoot why a release build doesn't work on the device but a debug version does. With a release build, the app starts, default PNG displays and the app dies. I've commented everything out of applicationDidFinishLaunching, which means it isn't a code issue. I see this error in the console: Mon Jan 18 21:17:39 unknow...

What is the framework/function used in Cocoa for detecting machines

I'm trying to get a listing of machines in my local domain, specifically ones running a administrative web service (_asip-webadmin). I've been fooling with NSNetService but it would seem that it's only good for Bonjour listings (as I can trap them just fine). I've tried something along the lines of: [mySearch searchForServicesOfType:@"_...

Is there any reason to build for LCD?

If I can do everything I need to with iPhone SDK 3.0, is there any reason to build for 3.1.2? 3.0 still runs on 3.1.2 devices but not the other way around right? ...

How do I store lines of text in a property list on the iPhone?

This is my scenario: I need to save 50 lines of text and access each line of text after my applications launches. That is, for a change in a control paramenter the text displayed on the iPhone should change (i.e. point to the second line of text, then the third...). Instead of going for SQLite, I want to store this data in a property l...

When to use static string vs. #define

Hi all. I am a little confused as to when it's best to use: static NSString *AppQuitGracefullyKey = @"AppQuitGracefully"; instead of #define AppQuitGracefullyKey @"AppQuitGracefully" I've seen questions like this for C or C++, and I think what's different here is that this is specifically for Objective C, utilizing an object, a...

Difference between [NSThread detachNewThreadSelector:] and -performSelectorInBackground

I've been using -performSelectorInBackground in many of my apps, sort of oblivious to -detachNewThreadSelector. Now I am wondering what the differences are between the two. Are they pretty much interchangeable, or are there differences and places where one is superior to the other? Thanks! ...

How to handle UISwitchView in edit functionality?

I am storing values of ON/OFF of switch view in the object. For the second time when we go to that view controller the switch view is always in the off state. But the value in the object is 1(ON).For the second time when we go to next controller, It should be ON state. ...

How to handle UICustomSwitch in edit functionality?

@interface UICustomSwitch : UISwitch { } -(void)setLeftLabelText:(NSString *)labelText; -(void)setRightLabelText:(NSString *)labelText; @end @implementation UICustomSwitch -(UIView *)slider { return [[self subviews ] lastObject]; } -(UIView *)textHolder { return [[[self slider] subviews]objectAtIndex:2]; } -(UILabel *)leftLabel...

MKMapView: Pins over the pop up

This question was asked earlier by someone else but never answered: http://stackoverflow.com/questions/1458052/mkannotation-map-pin-callout-pops-up-behind-other-map-pins. I ran into this problem yesturday and I have no clue what caused this problem and was hoping someone else has had this problem but figured it out. ...

iPhone app views logic

I have an iPhone app in development that requires three slides (views). The problem is, since I'm kinda new to this, I'm not sure what's the most logical way to approach this situation. I was going to use a UINavigationController, but then I noticed that the UINavigationController is meant for hierarchical content, which means that it s...

[iPhone] How to resize of Delete button of UITableView in delete editting mode?

I chage size of cell of a table to 20 but Delete button don't change. So, how to resize this button is this case? Please help me! ...

UIScrollview+UItextview touch event

hi i am using a scroll view and that scroll view i have UIIMageview and UITextview.My Question is -i want the Touchevent of Textview. ...

Hide, show annotation on MkMapView

How to hide annotation when zooming out the map view. I have a big number of annotation i have to hide them because if the region displayed on the map is too big you can see only the annotations. ...

Can't setImage.

Noob Alert, I am trying to change an image in a UIImageView. popCard is the IBOutlet pointed to the UIImageView - which is blank in IB. there are 5 possible images (Graphic0, Graphic1, etc.) For some reason it keeps displaying Graphic1. I got a feeling I'm missing something simple. Can you help please? This what i am using: getCar...

getting instance id for nsstring

I am trying to find out how to print instance id for known objects like NSString and NSNumber. When i try using it on any of those objects i just get content not the instance id. Help will be greatly appreciated Thanks ...

How do I get the current date?

How can I get the current date, and format it like "20/12/2010"? Thanks in advance..:) ...

How to access EAAccessories?

eaManager = [EAAccessoryManager sharedAccessoryManager]; [eaManager registerForLocalNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(gotDevice) name:EAAccessoryDidConnectNotification object:nil]; [eaManager connectedDevices] is always empty. How can I pair to a accessory? ...