objective-c

Receiver in expresseion is a garbage value

Hello, I am developing an iPhone app and are using xCode to do "Build and analyze". I get the message "Receiver in expresseion is a garbage value" pointing to the line of the return-row in my bode below: -(UIColor*)getLevelColor{ UIColor* tempCol; if (level==4) { tempCol= [[UIColor alloc] initWithRed:0.39f green:0.82f blue:0.32f ...

NSURLRequest requestWithURL: only works on device after I've visited a page in Mobile Safari

I have the following code: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.lenzerheide.com/modules/weather/iphoneweather.php"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval: 10.0f]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; When I test the app on an iPhone...

Suggest best way to use property (assign,retain,atomic,non atomic,copy) in Objective-C?

Hi, I have used properties in my project. Also i know the individual meaning of the properties. But i am not sure in which scenario, i have to use reatain, assign, copy..etc? please help me with some examples. Regards Sri ...

Calling @property accessor?

I wonder if someone can explain the following, are these both doing the same? As both call "setSeparatorColor" I would guess they are both calling the accessor for the property. [myTableView setSeparatorColor:[UIColor orangeColor]]; . [[self myTableView] setSeparatorColor:[UIColor orangeColor]]; Gary. ...

Rotate view using CGAfffineTransformRotate

I have a circular image which i am trying to rotate so that the yellow and black striped circle stays under the users finger and rotates in both directions. I have this so far: - (void)handleJogShuttle:(UIPanGestureRecognizer *)recognizer { UIView *shuttle = [recognizer view]; if ([recognizer state] == UIGestureRecognizerState...

iPhone DRM implementation for audio and video

I've done a lot of googling, to no avail, Im interested in knowing what my native or third party options are for implementing DRM to protect audio (say in a spotify like scenario) and video (for VOD applications) i've seen mention of widevine but all the content seems to be at least 18 months to 2 years old. What options do i have for im...

iphone programming ?. Change UITableViewCellEditingStyle image ?

Hello Fellows, I just need to know is it possible to change UITableViewCellEditingStyle image ?. If possible please tell me How to do that? ...

How to send CVImageBufferRef over the network in iOS?

Hi, I want to send a CVImageBufferRef I got from - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{ CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); } over the network using NSOutputStream's write:maxL...

how to use the UINavigationController to switch the page

Hi, everyone, I want to ask a question about the UINavigationController on iPhone application. I create a UINavigationController and 2 view controller (rootViewController.m and detailViewController.m) .In the rootViewController, it contains the UITableView, when the user click, it will call the detailViewController, but I don't know how...

Call method in nested parent controllers

I have a UIViewController that has an UIPopoverController that has an UINavigationController then a UIViewController. How can I from the child UIViewController call a method (eg. -(void)update) in the parent UIViewController? tried many combinations but still didn't work. ...

Objective-C, iPhone SDK basics

OK, this is going to be a stupid question but anyway I have nowhere to ask it except here. I have two buttons and there must be a switch-case statement performed on tapping any of them. Of course I can put this statement in each IBAction code block but this code would look terribly. I tried to put swith-case into a separate method and ...

How to filter the ABAddressBook, firstname with given string in iphone ?

Hi, I would like to filter my iphone AddressBook. I will get the starting character of the names from a textfield. And with respect to the characters entered in the textfield, i need to popup the people picker. so that we can select the people names starting with the entered character. This is same as searching the address book. Can y...

Setting an NSNumber property out of scope

For some or other reason when I call the init method and try and set the property it never seems to work: //This is where I am setting the value Hotel *newHotel = [[Hotel alloc]initWithCoordinate: coordinate hotelId:[NSNumber numberWithInt:1234]]; //This is the implementation of the method I am calling - (id)initWi...

Objective-C: Add an observer to an NSMutableDictionary that gets notified when count reaches 0

Hi there, I would like to be notified, when an NSMutableDictionary's count reaches 0. Is that possible without extending NSMutableDictionary (which I heard you should not really do)? Could I e.g. have a category that mimicks remove methods by calling the original ones while checking whether count is 0? Or is there maybe a simpler way. ...

how can i add multiple web SubViews in a single view ?

i'm doing my first iPAD project. i've recently learnt objective C so i do not have in depth knowledge of it. I'm writing a code to generate subviews. Similar concept to that of "SAFARI". i've to keep a track of all the recently opened url and display that web page as a subview. ...

Resolve iPhone/iPod/Mac computers connected to a local LAN

Is it possible to easily resolve all Apple OSX devices connected to a single LAN network (the same switch / hub is enough)? I know OSX provides Bonjour service and you can easily query other Macs connected to the network. But I am not sure whether iPhone / iPods provide similar identification. The identification should be device id - in...

Calling alloc on a pointer

I'm using cocos2d with objective C. I have a class called CrystalineBubble that is currently empty it inherits from CCNode. #import <Foundation/Foundation.h> #import "cocos2d.h" @interface CrystalineBubble : CCNode { } @end When I try to create an instance of that class and alloc it I get the warning 'CrystalineBubble' may not ...

UIButton with UIImageView subview to show animated images

Hi, I'm trying to create a button which displays animated images. I read in this post the suggestion that I add an UIImageView (with an array of animationImages) as a subview of the UIButton. I tried to do this like so: (animation1 is a UIImageView object declared in the header) - (void)viewDidLoad { UIImage *image1 = [UIImage imageNam...

settings things to nil in viewDidUnload()

What is the purpose of setting things to nil in the viewDidUnload() method? I know it has something to do with releasing memory, but I thought that's what release was for in the dealloca() method. How do you know which things to put in viewDidUnload() to set to nil? ...

View Unicode characters in xcode console

Hi all, I need to see some String with unicode characters in the xcode console when I do NSLog(@"some unicode characters.."). Eg: abc\u0001xyz\u0002pqr... Biut xcode console only shows the abcxyzpqr. It doesn't show the intermediate unicode characters. Does anyone know how to view this? ...