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

  • Home
  • SEARCH
  • 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 9160655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:47:22+00:00 2026-06-17T13:47:22+00:00

I have an app submitted to Apple Store, and it passed. But I found

  • 0

I have an app submitted to Apple Store, and it passed. But I found there was a bug will make the app crash. Finally, I found the real problem is a snap of code has the opposite result.

code:

CGPoint now;
CGPoint old;
UIView *lastDot;
now = dotView.center;
if(lastDot){
    //release version, will go here. then crashed.
    old = lastDot.center;
}else{
    //debug version, will go here. run ok.
}

I declare a UIView pointer, and check it with “if statement”,

UIView *lastDot;

the debug version consider the lastDot as nil, but the release version think is not null.

can anyone give me any idea? thank you.

  • 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-06-17T13:47:24+00:00Added an answer on June 17, 2026 at 1:47 pm

    The issue is due to uninitialized pointer.

    Initialize it to nil for avoiding such troubles.

    UIView *lastDot = nil;
    

    I know you already got the answer.

    I just want to add some points too:

    Pointers are just like any other variable: if you don’t explicitly set
    them to a value, the value will be undefined means a random value. If
    you then accidentally access the variable, very bad things can happen.

    Sometimes people recommend that pointers be assigned to NULL, the
    universal value meaning “this pointer doesn’t point at anything”,
    because a lot of code already checks for NULL pointers. For example,
    if you call [nil release], it’s guaranteed to do nothing. If you
    passed an uninitialized pointer in who knows what would happen.

    It’s really just a safeguard against programmer error. If you
    initialize pointers to a reasonable value, it’s less likely that an
    uninitialized pointer will cause a system crash sometime in the
    future.

    When you don’t initialize a pointer and then try to use it, you have 3
    problems:

    • It might be pointing at memory you don’t have access to, in which case it causes a segmentation fault and crashes your program
    • It might be pointing at real data, and if you don’t know what it’s pointing to, you’re causing unpredictable (and very hard to debug)
      changes to your data.
    • You have no way of knowing if it’s been initialized or not – because how do you tell the difference between a valid address and the address
      that happened to be there when you declared the pointer?

    Initializing every pointer to nil seriously decreases or eliminates
    those problems:

    • If I try and use it, it will still segfault, but at least I can test if it’s NULL and act accordingly – I can know that it WILL segfault,
      and do something else. If it’s a random value, I don’t know anything
      until it crashes.
    • If you initialize it to nil, I can’t make it point to data unless I explicitly tell it to. So I only modify what I meant to.
    • As implied above, I can tell when I’ve initialized it and when I haven’t, and make a decision.

    Obviously it’s a matter of style, and it is possible to write an
    application where variables are only initialized to their intended
    value, but I feel it is safer and easier to initialize them to nil
    always. Even the best programmers make typos – nil makes it easier
    to know when that’s happened.

    Reference :

    1. eskimo
    2. Initializing pointers always necessary
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Qt app I submitted to Apple Mac App Store. It's been
I submitted an iPhone app to the store that got approved, but some things
I submitted my app to iTunesConnect and Apple give me back the following crash
I have started the steps to submit my app to the apple store, andI
Apple recommends cropping out the status bar from screenshots submitted to the app store.
I've recently submitted an application to the Mac App Store and have received an
I have successfully submitted and got approved my app in the app store. Now
I have submitted an iphone app with in-app purchase But my Binary is rejected
I have just created an iPhone application and submitted it to Apple Store. The
I have an iPad app that I submitted to Apple successfully using my personal

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.