iOS Variable names and memory management

I am a bit confused by the underscore naming and the self. Is the following code OK?

@interface MyClass()

@property (nonatomic,retain) NSString        *name;
@property (nonatomic,retain) NSString        *surname;


@implementation MyClass
@synthesize name = _name;
@synthesize surname = _surname;

Then when I need to assign a value I do this = [someParam retain];


No this is not ok, since the will also retain the value as your declared in the property.

This wil retain: = someParam;

Other way the write then same (be aware to release the current var):

if (_name != someParam) {
    if(_name) {
       [_name release], _name = nil;
    _name = [someParam retain];

you don't have to repeat the retain :)

just: = someParam;

but for the rest I think it's ok

No this is not right as you have to use the alias _name like

    [_name release];
    //retain the object

Need Your Help

Selenium WebDriver with Perl

perl selenium-webdriver

I am trying to run the Selenium driver with Perl bindings, and due to the lack of examples and documentation, I am running into some roadblocks. I have figured out how to do some basic things, but ...

google map zoom out limit

javascript google-maps-api-3

How do I set zoom out limit on the map, it currently lets me zoom out too far to the point that I see multiple world maps: