Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6772383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:32:35+00:00 2026-05-26T15:32:35+00:00

my both code is working good..but i wants to know..who is better… and which

  • 0

my both code is working good..but i wants to know..who is better…
and which i use ?

first code…..

NSString *advance=[[NSString alloc]initWithFormat :@"Pay in Advance Rs %i",pro.s_advance ];
UILabel *label1 =[[UILabel alloc]initWithFrame:CGRectMake(10,5,200,40)];
label1.text=advance;
[cell.contentView addSubview:label1];
[label1 release];
[advance release];

and second code is…..

UILabel *label1 =[[UILabel alloc]initWithFrame:CGRectMake(10,5,200,40)];
label1.text=[NSString stringWithFormat:@"Pay in Advance Rs %i",pro.s_advance ];
[cell.contentView addSubview:label1];
[label1 release];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:32:35+00:00Added an answer on May 26, 2026 at 3:32 pm

    The first and second codes are equal.

    The only difference is that in second one you are creating autoreleased object of type NSString. In first one you are releasing manually object of type NSString as it is not autoreleased: [advance release];

    So there are no memory management issues and you can use any of that approaches.

    I would prefer second one as code will be more cleaner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone tell if it's possible to get an OpenCL code working with both
I can write my code in both the ways to achieve my objective, but
I am working on several iOS projects which will have a good bit of
When I write client side code, I use HTML/CSS/JavaScript and lately jQuery to both
I'm totally new to both java and java Server worlds... But I've a good
I wrote two code both are same Using NSURLConnection and Using AFNetworking. My NSURLConnection
I have in my code both simple css/jquery menu and google.visualization.PieChart . However lately
Do we have a way to view assembly and c code both using gdb.
I have several questions I need help with. I'll add both my code and
I have code seperated in two domain. Both domains and code is trusted. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.