|
I'm trying to do little iPhone app where you enter a set of 3 (x,y) coordinates, and then you touch the 'draw' button and it creates a new view and draws it on the screen. Easy enough, right? I created a Single-view Applications using Xcode. So it gave me an AppDelegate, ViewController, and Xib file. I put the text fields and buttons and then when you click the button, it loads another Xib file and controller: code:
Here's where I'm stuck since I'm still stuck thinking of this in other languages. How do I get the numbers from the first screen (using [UITextField.text intValue]) to the second one? I tried making properties in the CanvasViewController class but that's where I got stuck. I need to get those variables to the view. I thought I could just do something like [view filesowner].x1 or something. I could probably do this a 'triangle' singleton, right?
|
# ? Apr 18, 2012 04:18 |
|
|
# ? Jun 1, 2024 06:06 |
|
Something like this:code:
code:
Doc Block fucked around with this message at 05:09 on Apr 18, 2012 |
# ? Apr 18, 2012 05:03 |
|
xgalaxy posted:Client is using Unity3d, which is compiled arm only. The thing is, instruction formats — especially 16-bit instruction formats — are so densely encoded that pretty much any arbitrary byte sequence can be interpreted as an instruction stream. My understanding is that otool tries to distinguish them by recognizing likely ARM prologues vs. likely THUMB ones, but that's obviously a fallible heuristic. In this case, this is pretty clearly an ARM instruction sequence, because if you reinterpret it as 32-bit (little-endian) instructions, the top four bits of almost every instruction are 1110. In the ARM instruction format, the top four bits are the condition code, and 1110 means "always". I also took the time to manually decode the first instruction, and (if I got it right) it's ldr r3, [r0, #8], which is pretty plausible.
|
# ? Apr 18, 2012 05:51 |
|
I have an app that has a main menu (scene 1). Select the first option, it takes you to a screen that allows you to set some options (2) and then transitions to a final scene (3) where you do various things. When you're done, you go back to the main menu. A navigation controller, pushing views on the stack, seems wrong with a 1->2->3->1 series of transitions. (feel free to tell me if I'm wrong; new to iOS) So I tried to do it with a Custom Segue. This, of course, works from Apple's documentation at https://developer.apple.com/library/IOs/#featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomSegues/CreatingCustomSegues.html : code:
Flush with success, I tried to add animation by following some online examples, but I seem to be missing some fundamental point because I don't actually get any animation (although the views do transition). Example of non-animating code: code:
|
# ? Apr 18, 2012 06:39 |
|
rjmccall posted:The thing is, instruction formats — especially 16-bit instruction formats — are so densely encoded that pretty much any arbitrary byte sequence can be interpreted as an instruction stream. My understanding is that otool tries to distinguish them by recognizing likely ARM prologues vs. likely THUMB ones, but that's obviously a fallible heuristic. I think you are right. What seems most telling is that otool output of the object file itself looks fine. Thanks for taking the time to help me sort this out.
|
# ? Apr 18, 2012 06:42 |
|
Kyth posted:I have an app that has a main menu (scene 1). Select the first option, it takes you to a screen that allows you to set some options (2) and then transitions to a final scene (3) where you do various things. When you're done, you go back to the main menu. This is perfectly fine, so long as you pop off the scenes at the end instead of just pushing another Scene 1. Make Scene 1 the navigation controller's root view controller, and then at the end of Scene 3 you'd just do something along the lines of code:
Doc Block fucked around with this message at 07:27 on Apr 18, 2012 |
# ? Apr 18, 2012 07:25 |
|
What tools (if any) are people using for Project Management?
|
# ? Apr 18, 2012 09:41 |
|
You should strongly consider project.pbxproj
|
# ? Apr 18, 2012 13:22 |
|
Doc Block posted:Not to be a jerk, but if the parent property wasn't set somewhere then yeah, it isn't going to work. Thanks for the info. Most of the sprites I add into arrays have a whole class included so I can edit my own custom properties. So after I make a temporary pointer off the array index I can just do tempClass.health -= 5 or access the sprite directly like tempClass.sprite.opacity = 25.
|
# ? Apr 18, 2012 13:34 |
|
Bob Morales posted:I'm trying to do little iPhone app where you enter a set of 3 (x,y) coordinates, and then you touch the 'draw' button and it creates a new view and draws it on the screen. Easy enough, right? I might be completely wrong about it, but this is how I've handled things in the past. Create properties in CanvasView that essentially define what it needs to draw, and no more. Set these from the ViewController either when the ViewController is loaded, or when a ViewController property is updated. The custom drawing code should go in CanvasView's -(void) drawInRect method. Doc Block: That would be a nice way to do it, but unfortunately drawInRect: is a method of UIView, not UIViewController, which makes things a bit more tricky.
|
# ? Apr 18, 2012 16:01 |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
AlwaysWetID34 fucked around with this message at 17:01 on Jan 18, 2019 |
# ? Apr 18, 2012 17:36 |
|
Doc Block posted:This is perfectly fine, so long as you pop off the scenes at the end instead of just pushing another Scene 1. Hmm. Okay. The semantics of a navigation controller, with the title bar and the back buttons don't quite work in all the screens, but I'll go read the docs and see what I can do to deal with that. Thanks for the help. Still curious why the animation wasn't working in the custom segue outside of a push call, but that can wait until I need one. Maybe by then I'll know enough to puzzle through it on my own.
|
# ? Apr 18, 2012 19:03 |
|
PT6A posted:Doc Block: That would be a nice way to do it, but unfortunately drawInRect: is a method of UIView, not UIViewController, which makes things a bit more tricky. Whoops! Yeah, drawInRect: is gonna be in your custom view's drawing code.
|
# ? Apr 18, 2012 20:12 |
|
rjmccall posted:I also took the time to manually decode the first instruction, and (if I got it right) it's ldr r3, [r0, #8], which is pretty plausible. BTW, I think you were close =D quote:build/ios/armv7/release/obj/libtommath/bn_mp_cmp_d.o:
|
# ? Apr 18, 2012 20:15 |
|
I think that's a different instruction stream. The first instruction in the one you posted before was definitely e5903008. It's equivalent, anyway, because the value in r2 in the new stream was copied there from r0 in the first instruction, so it's apparently just a slightly different register allocation. That's not surprising, because we've rewritten the register allocator since we last updated llvm-gcc.
|
# ? Apr 18, 2012 21:15 |
|
rjmccall posted:I think that's a different instruction stream. The first instruction in the one you posted before was definitely e5903008. It's equivalent, anyway, because the value in r2 in the new stream was copied there from r0 in the first instruction, so it's apparently just a slightly different register allocation. That's not surprising, because we've rewritten the register allocator since we last updated llvm-gcc. Yea it was recompiled with a different compiler. Sorry Anyway. Thanks again for all your help.
|
# ? Apr 18, 2012 21:29 |
|
I'm working through the Big Nerd Ranch 4th edition Cocoa for OSX book and I'm kind of banging my head against a wall with this one stupid visual thing: How the flying gently caress do I get rid of this column resize separator? In the inspector, Table View columns are set to 1. I've tried flipping everything I can think of. I've connected my dataSource and the table works fine, it's just that stupid resize indicator that I can't get rid of. Words can't describe the shame I feel having to ask a question this basic
|
# ? Apr 18, 2012 23:50 |
|
Turn off 'resizable', then hide and re-show the header.
|
# ? Apr 18, 2012 23:53 |
|
Here's my inspector: Do you mean uncheck "resizing" and then uncheck and re-check "headers"? Because I just tried that and no dice
|
# ? Apr 18, 2012 23:55 |
|
You might need to manually size the column in interface builder so that it takes up the width of the entire table.
|
# ? Apr 19, 2012 00:01 |
|
Ugh, that's what I was worried about. What a kludge. I'm actually going to ask on Big Nerd Ranch's website. some kinda jackal fucked around with this message at 00:06 on Apr 19, 2012 |
# ? Apr 19, 2012 00:03 |
|
Yeah you did what I did. All I can say is worked on my machine :-(
|
# ? Apr 19, 2012 00:16 |
|
drat. Wonder what the difference could be If it's not too much trouble, could one of you guys try to open my project and see if you can get it to work right? http://dl.dropbox.com/u/58959/SpeakLine.zip e: I don't mean do any work for me, just try to disable the resize handle, build and run. Curious to see if it's my machine or my project or what. some kinda jackal fucked around with this message at 00:36 on Apr 19, 2012 |
# ? Apr 19, 2012 00:18 |
|
What are yalls thoughts on readonly properties vs. method declarations?code:
E: Fixed typo Carthag Tuek fucked around with this message at 00:41 on Apr 19, 2012 |
# ? Apr 19, 2012 00:23 |
|
Well first off you can't allocate objects on the stack, so it'd be NSArray *items. The differences I can think of right now are: that you can declare a property as (non)atomic, whereas you'd have to put it in a comment over a method; and that properties can be enumerated separately from methods by the runtime.
|
# ? Apr 19, 2012 00:34 |
|
Martytoof posted:drat. Wonder what the difference could be It gets fixed for me if I resize the table view in the xib so it's narrower than the column separator, then resize it back out to its old width.
|
# ? Apr 19, 2012 00:38 |
|
Er yeah that was a typo. NSArray *items indeed.
|
# ? Apr 19, 2012 00:40 |
|
Ugh loving THANK YOU pokeyman. That's got to be a bug of some kind. Wonder if I should try to report it.
|
# ? Apr 19, 2012 00:41 |
|
If it helps, NSTableView is a total poo poo to work with.
|
# ? Apr 19, 2012 00:51 |
|
pokeyman posted:If it helps, NSTableView is a total poo poo to work with. This pretty much sums up any TableView like class in any language / framework I've ever used.
|
# ? Apr 19, 2012 02:31 |
|
Hey is there a checkbox I can set somewhere to tell XCode to @synthesize my properties with the underscored local variables by default? I could have sworn it did that sometimes and I just created a new class and I had to go back and edit my @synthesize statements to reflect what I wanted.
|
# ? Apr 19, 2012 03:53 |
|
I haven't found such a wonderful checkbox. If it's any consolation, Xcode will autocomplete the underscore.
|
# ? Apr 19, 2012 03:56 |
|
xgalaxy posted:This pretty much sums up any TableView like class in any language / framework I've ever used. Yeah, it's an odd constant. UITableView might be the best I've seen and I still swear at it regularly.
|
# ? Apr 19, 2012 03:57 |
|
pokeyman posted:I haven't found such a wonderful checkbox. If it's any consolation, Xcode will autocomplete the underscore. Yup. It seems to know what I want it to do so I was hoping there was some way to make it do it without my intervention. Ah well. Oh nevermind that's a behaviour thing I can change, because I NSLog some poo poo. I think I got this. some kinda jackal fucked around with this message at 04:23 on Apr 19, 2012 |
# ? Apr 19, 2012 04:20 |
|
It's in the new compiler in Xcode 4.4... Properties are always synthesized by default so no more @synthesize.
|
# ? Apr 19, 2012 04:45 |
|
What really? So I can tell it to auto-synth the properties with underscores? That owns. 4.4'll probably be out by the time I'm doing any serious development anyway.
|
# ? Apr 19, 2012 04:51 |
|
rjmccall can confirm but I believe it just automatically makes the ivar with an underscore. You just don't have to think about it anymore.
|
# ? Apr 19, 2012 05:50 |
|
Small White Dragon posted:What tools (if any) are people using for Project Management? Redmine with some custom hooks to hudson for bigger projects where I'm running CI to make blinkenlights for nervous clients
|
# ? Apr 19, 2012 06:37 |
|
Martytoof posted:drat. Wonder what the difference could be The workaround posted didn't work for me, but I entered a table column width of 204 in the size inspector, which hid the right edge.
|
# ? Apr 19, 2012 08:40 |
|
|
# ? Jun 1, 2024 06:06 |
|
Martytoof posted:What really? So I can tell it to auto-synth the properties with underscores? Underscore-prefixed ivars will be the default for implicitly synthesized properties. You can override the behavior with an explicit @synthesize statement. But then you wouldn't get to experience one of the great programming joys, deleting unneeded code.
|
# ? Apr 19, 2012 08:51 |