Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Button Looping and me!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Nethfel" data-source="post: 1290520" data-attributes="member: 89124"><p>Hi, welcome to the forums.</p><p></p><p>First, you may want to use code tags to make your code easier to read (maintains indenting and doesn't implement smileys)</p><p></p><p>Second - you have the line: [self release]; - I can't see ANY reason why you would want to do this unless you want to create a crash. If you need to show a different view (or return to a previous view), there are specific ways of handling that.</p><p></p><p>Third - I'm not sure what you mean by having it generate the random number outside of the button - at what time would you want the random number to be generated? In terms of guesses, you need to keep a counter to see how many guesses were entered and when that counter reached your max guess threshold that it would throw a you lost message.</p><p></p><p>Fourth - I'm not sure if this program is ultimately meant for OSX or an iOS device. You mentioned Cocoa, which would imply you intend this for OSX (iOS is Cocoa Touch) - if this is for OSX, you may want to ask that this thread get moved to the OSX development thread <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Nethfel, post: 1290520, member: 89124"] Hi, welcome to the forums. First, you may want to use code tags to make your code easier to read (maintains indenting and doesn't implement smileys) Second - you have the line: [self release]; - I can't see ANY reason why you would want to do this unless you want to create a crash. If you need to show a different view (or return to a previous view), there are specific ways of handling that. Third - I'm not sure what you mean by having it generate the random number outside of the button - at what time would you want the random number to be generated? In terms of guesses, you need to keep a counter to see how many guesses were entered and when that counter reached your max guess threshold that it would throw a you lost message. Fourth - I'm not sure if this program is ultimately meant for OSX or an iOS device. You mentioned Cocoa, which would imply you intend this for OSX (iOS is Cocoa Touch) - if this is for OSX, you may want to ask that this thread get moved to the OSX development thread :) [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Button Looping and me!
Top