objective-c

Quick brush-up on C++ for a C/Obj-C programmer?

I'm being offered a C++ job and need a quick brush-up project so I can become fluent in the language again. Currently I develop iPhone applications and became fluent in C/Obj-C from a background of Python, Java and C# in a matter of days. I'm looking for an idea for a small project, or a brush-up sort of course online that I can complete...

Languages for iPhone development

What languages can be used to develop for the iPhone? I know, I know: canonically speaking, Objective-C is the one and only language can be used to develop for the iPhone. But I'm appealing to the creative hackers out there. Is there anything - no matter how hacky - other than Objective-C which can be used to develop for the iPhone? (ot...

Feedback on my first Objective-C code (a QuickLook plugin)

I've written a fairly simply QuickLook plugin, which displays the files of a .torrent file, The complete code is here on Github, and the main file is torrent.m The reason I'm looking for feedback is it's acting slightly weirdly.. After building/installing the plugin (into ~/Library/QuickLook/), and running.. qlmanage -r; qlmanage -p ~...

How to use @encode() to get @"NSArray" in Objective-C

I'm using the runtime functions to get the type of a property (thanks to eJames for helping me to figure out this way). The attribute string of the property looks like this: T@"NSArray",&,Vstuff I need to check if the property type is an array, at the moment I'm doing it like this: - (BOOL)valueForKeyIsArray:(NSString *)key fromT...

What describes @property(.....) best? What's that actually good for?

All I think to know is, that it marks a property "public". And it creates setters and getters automatically. But when I don't have that, are my properties private? What's the name of this "technology"? Why's there an @ in front of "property"? ...

Why do I have to clean up memory if I have an IBOutlet with "retain", but not when I have one with "assign"?

Example: @property (..., assign) there, I don't do any cleanup in the dealloc Method. But when I have an @property (..., retain) then I would do so. I have that from somewhere in the internet. Don't remember the site. Well, I know that the retain-keyword in the compiler directive would make a retain count +1, but actually I think...

If my property has no setter (readonly), is it true that UIKit retains the value if it's not NSNumber or NSValue?

I want to figure out in which cases I need to care about memory management when it comes to properties. I wrote down something from a site I don't remember anymore, where they said that if a property has any value other than NSNumber or NSValue, and if it has no setter, then UIKit would autorelease the old value and retain the new one. A...

What happens exactly, when I set an property to nil in the dealloc method?

Example -(void)dealloc { self.myOutletProperty = nil; [super dealloc]; } I guess that a sort-of virtual setter will be called. But what exactly happens here? Why nil? ...

How do I find out if I need to retain or assign an property?

Are there any good rules to learn when I should use retain, and when assign? ...

Can I use a mono library from Objective-C (on the iPhone)?

Hi I am investigating a port of an app to the iPhone. My existing business logic is C# in a class library dll. It does some processing as well as sommunicating with web sites. I understand that Objective-C is the best thing to develop with on the iPhone and I'm prepared to dive in, but if possible I want to avoid re-writing the existin...

Testing own OS X framework

I'm writing my first OS X Objective-C framework, but I do not know how to test it. How can I execute methods and classes in framework for testing purposes? ...

How can I get current scroll position on UIWebView

Hi I have a UIWebView And how can i get It's scroll position ? I know, that UIWebView has a UIScroller subview. But I can't get offset of this UIScroller ((( ...

Which are the Top Level Objects I need to create Outlests for in the File's Owner of my Nib, so that I have less memory problems?

Apple says, that I need to have Outlets in my File's Owner for all my top level objects in a Nib file. As much as I know, these objects are NOT the File's Owner itself (would make no sense, right?) and the First Responder. I am unsure about: The View object in the Nib, and any controller object in the nib. Do I need an outlet for thos...

What do I have to consider in an multiview-application, when it comes to low memory warnings?

Somewhere I was reading that I would run into memory problems when I give up a view temporary due to an low memory warning (loading it again as soon as the user wants to see it), if theViewController class does not do things like this on every outlet of that view: -(void)dealloc { [myView release], myView = nil; [myLabel release...

Which iPhone OS memory management rules and how-to's do you know? What great links do you have for that topic?

Currently I am jumping into the ice cold water called "memory management in iPhone OS". Here's one rule i've learned: Every time I see an alloc in my method, I will release that corresponding variable at the bottom of the method. Every time I create an @property(...) in my header file which says copy or retain, I put a release message...

Programmatically retrieve memory usage on iPhone

I'm trying to retrieve the amount of memory my iPhone app is using at anytime, programmatically. Yes I'm aware about ObjectAlloc/Leaks. I'm not interested in those, only to know if it's possible to write some code and get the amount of bytes being used and report it via NSLog. Thanks. ...

Scrolling with two fingers with a UIScrollView

I have an app where my main view accepts both touchesBegan and touchesMoved, and therefore takes in single finger touches, and drags. I want to implement a UIScrollView, and I have it working, but it overrides the drags, and therefore my contentView never receives them. I'd like to implement a UIScrollview, where a two finger drag ind...

Resizing a UIView to make it scrollable in a UIScrollView

I added a UIScrollView in my appDelegate, and then did scrollView.contentSize = CGSizeMake(720, 480); scrollView.showsHorizontalScrollIndicator = YES; scrollView.showsVerticalScrollIndicator = YES; scrollView.delegate = self; [scrollView addSubview:viewController.view]; [window makeKeyAndVisible]; Where view Controller loads up a UIV...

NSURLRequest - encode url for NSURLRequest POST Body (iPhone objective-C)

I am sending a post using NSURLRequest. NSURL *url = [NSURL URLWithString:someUrlString]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d", [parameterString length]]; [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHT...

How can I write an function in objective-c, that I can use over any object in my iPhone app?

I want to create an function which I pass an object. Then, this function should print out some information for me. like: analyzeThis(anyObject); I know about methods, but not how to make a function. As I understand, a function works global in all methods and classes, right? ...