objective-c

method call between different class in Objective c

Is it possible to call method from one class to another where two classes from two different parent class.Suppose one from UIImage class and another from UIViewController class???? thanx for reply. ...

How do i get red green blue and alpha back from a UIColor object?

I am getting a UIColor returned from this method: - (UIColor *)getColor { return [UIColor colorWithRed:redSlider.value green:greenSlider.value blue:blueSlider.value alpha:1.0]; } and getting color like this: SelectedColor=[(ColorPickerView *)alertView getColor]; Now I want to get red, green, blue from SelectedColor, in order to...

How to use webservice in iphone objective c ?

Hi, I need great video tutorial for using webservices in iphone objective c.My requirment is already values are in webservice, so just i want to access the webservice and validate username and password and return back to true or false get value display on the iphone. If anybody have idea about tutorial please help me out.. ...

Subview remove and add in objective c/iphone

I have a UIViewController class where I create a UIView instance. And then I initialize (means fill) it with 25 subviews each containing an image (1, 2, ..., 25). Then after clicking 5 times in these image I called a function where I used for(UIView *subview in [contentView subviews]) { [subview removeFromSuperview];//ContentView n...

draw a line using core graphics when touch moves in iphone?

how do i draw line when moving finger across screen in iphone using core graphics. ...

How to reuse a UILabel? (Or any object)

This: UILable *myLabel = [[UILabel alloc] init]; UILable *myLabel = [[UILabel alloc] init]; gives me a redefinition error. But this: for(i=0;i<5;i++) { UILable *myLabel = [[UILabel alloc] init]; // some label code here [self.view addSubview:myLabel]; [myLabel release]; } doesn't. So...

how to pinch, swirl, stretch, uiimage using coregraphics?

how do we do stretch,pinch,swirl effect on uiimage using core graphics..? something like this .this screenshot was of application named PhotoTwist ...

does anyone know how to use colorcodes instead of just assigning colors with UIColor

Like the title says I want to use a color code instead of doing something like this lblTemp.textColor = [UIColor colorWithRed: 0 green:0x99/255.0 blue:0 alpha:1.0]; for instance I have the following colorcode #30ae36 how can I use this one instead of doing the above. ...

Accessing Property Values of a Protocol?

Hey guys, I have a protocol which defines a number of ObjC-2.0 properties, like so: @protocol Repeatable <NSCoding> @required @property (nonatomic, retain) Date *startDate; @property (nonatomic, retain) Date *endDate; @end I have another class that implements the protocol: @interface AbstractRepeatable : NSObject <Repeatable> And f...

Click-through buttons and not raising the window

The iTunes mini-player (to give just one example) supports click-through where the application isn't brought to the front when the play/pause and volume controls are used. How is this done? I've been looking through Apple's documentation and have a little to go on, in Cocoa Event-Handling Guide, Event Dispatch it states: Some even...

Why getting differences between using XCode and xcodebuild?

Can anyone explain why I get different results when compiling the same XCode 4.x project using the GUI and xcodebuild command-line? XCode GUI Perform a clean Build "Release" target Build successfully xcodebuild Perform a clean Run "xcodebuild -configuration Release" Results in the following errors: /Developer/usr/bin/gcc-4.0 -x o...

Even with self, object still autoreleased

In regards to this posting http://stackoverflow.com/questions/1481871/why-does-self-protect-memory-space/1481882#1481882, I'm using 'self' to access aArray. Yet, I still get an invalid object in the didSelectRowAtIndexPath: method. In the root controller, I access aArray like this: MyAppDelegate *theDelegate = [[UIApplication sharedAp...

Balance retain with release?

I am just curious, do I need to add a further [name release] elsewhere to match up with the retain here in the getter? - (NSString *)name { return [[name retain] autorelease]; } gary ...

CoreData modeling relationship review

I have an AccountCredential object which holds standard user credentials and then another object that holds several of these AccountCredential objects. When I model this in CoreData, I'd like to know if AccountCredential needs to have a relationship link back to Account for every instance it holds. Would I set it up in CoreData as this...

How to add a pop-up menu to a NSToolbarItem?

Hi, I'm trying to open a pop-up menu from a NSToolbarItem. I tried following this example but I can't use that class method because NSToolbar and NSToolbarItem inherit from NSObject and not from NSView. Apart from creating a custom view, what is the best way to open a pop-up menu from a NSToolbarItem? ...

Getting Xcode to drop "No XXX method found" warning when delegating

This could be me doing the design pattern wrong. I'm implementing asynchronous delegation in an application that uses NSURLConnection. An object wraps the NSURLConnection and handles its delegated messages; that works fine. Now I'm defining my own delegates in the object that uses it (NSURLConnection messages ConnectionWrapper, Connecti...

IPhone - UIImage to Binary String

I have this bit of code that get the image i have picked from the Camera and displays it into a UIImageView. I want to convert the image to a binary string so i can then make a URL call and pass it back to the server. How would I modify this code to get my binary string? - (void)imagePickerController:(UIImagePickerController *)picker ...

Where to release copy in setter?

In my setter I have a incoming string that I am copying to avoid any trouble should the original be modified. - (void)setName:(NSString *)newName{ if(name != newName) { [name release]; name = [newName copy]; } } My question is: as I am doing a copy where should I release it, or do I just do an autorelease? i.e. - (v...

How to create a menu when a user right-clicks on the dock-icon of cocoa app on Mac?

Hi guys, How to create a menu when a user right-clicks on the dock-icon of cocoa app on Mac? Thank you very much in advance! Max ...

NSCollectionView: Can the same object not be in the array more than once or is this a bug?

I may be doing this all wrong, but I thought I was on the right track until I hit this little snag. Basically I was putting together a toy using NSCollectionView and trying to understand how to hook that all up using IB. I have a button which will add a couple of strings to the NSArrayController: The first time I press this button, my...