|
Do multiple UITableViews with the same view classes registered for reuse all pull from the same reusable view pool, or do they each create and pull from their own? If the latter, can they be told to pull from the same pool? edit: seems like they are separate per instance. That sucks.
|
# ? Jul 31, 2014 17:57 |
|
|
# ? Jun 6, 2024 05:49 |
|
lord funk posted:Do multiple UITableViews with the same view classes registered for reuse all pull from the same reusable view pool, or do they each create and pull from their own? If the latter, can they be told to pull from the same pool? They pull from the same reuse identifier. If you want to reuse the same cells, you have to make the cells themselves configurable for those different modes. That said, hiding a view takes it out of the render tree, so if you're doing a ton of reuse it might be worth it to amortize the really expensive cost of instantiating and adding the views in each cell for all of its states, and hide/unhide as needed. That, or aggressively bug the AsyncDisplayKit people to open-source their sliding range stuff (not private info; discussed at NSLondon, publicly streamed), which should be particularly useful for smooth tableview operation.
|
# ? Jul 31, 2014 18:26 |
|
I'm trying to get Game Center working on my simple game and I've been going through Ray Wenderlich's tutorial. So far I'm able to have a person login and authenticate, however I'm unsure how to pull up the gameViewController which I assume holds the matchmaking view. In his tutorial he has a storyboard that navigates from the navigationcontroller -> gameviewcontroller However for my sprite kit game, I have no storyboard, and it goes defaultViewController -> firstscene. I have the code that would you call in the navigationcontroller on the defaultViewController that loads first. After logging in Game Center it transitions to the first scene. However I'm unsure where to or how to transition to the gameViewController (which was a class that I had to create) to start the match making. http://www.raywenderlich.com/60980/game-center-tutorial-how-to-make-a-simple-multiplayer-game-with-sprite-kit-part-1 This is what I'm following. Any help would be great!
|
# ? Jul 31, 2014 19:23 |
|
Doctor w-rw-rw- posted:They pull from the same reuse identifier. If you want to reuse the same cells, you have to make the cells themselves configurable for those different modes. That said, hiding a view takes it out of the render tree, so if you're doing a ton of reuse it might be worth it to amortize the really expensive cost of instantiating and adding the views in each cell for all of its states, and hide/unhide as needed. I thought my problem was the opposite: not a lot of reuse per individual UITableView, but among the pile of them, I figured there could be more sharing. After all that, it turns out what I really needed was to clean out all the UIImageViews and replace them with *much* less invasive UIViews, rasterize like hell, avoid allocating unnecessary views, and switch to programmatic creation of cells instead of nibs. Buttery scrolling ahoy.
|
# ? Jul 31, 2014 20:41 |
|
Manic Mongoose posted:I'm trying to get Game Center working on my simple game and I've been going through Ray Wenderlich's tutorial. So far I'm able to have a person login and authenticate, however I'm unsure how to pull up the gameViewController which I assume holds the matchmaking view. You probably need a UINavigationController.
|
# ? Aug 1, 2014 00:26 |
|
Doctor w-rw-rw- posted:That, or aggressively bug the AsyncDisplayKit people to open-source their sliding range stuff (not private info; discussed at NSLondon, publicly streamed), which should be particularly useful for smooth tableview operation. For whoever else cares: http://new.livestream.com/nslondon/anniversary/videos/57840338 I've been eating up this AsyncDisplayKit stuff.
|
# ? Aug 1, 2014 02:29 |
|
ultramiraculous posted:For whoever else cares: http://new.livestream.com/nslondon/anniversary/videos/57840338 This is great. Also I can't wait to switch over to it someday because my podunk attempts at getting off the main thread are pitiful by comparison.
|
# ? Aug 1, 2014 18:35 |
|
Ugh. I just spent over an hour debugging an AVAudioPlayer "problem". No matter how the audio files were loaded, no matter what audio file I gave it, AVAudioPlayer wouldn't play any sounds. Not on the device, not on the simulator, not even in a little OS X test program. I was getting pretty mad, since AVAudioPlayer is so drat easy and I've used it successfully before. Then I realized that I wasn't keeping the AVAudioPlayer object anywhere. So it would be created successfully, the call to -play would succeed and it would technically start playback, but then execution got to the end of the method and ARC was helpfully releasing the AVAudioPlayer object, thus stopping sound playback before any sound could be heard.
|
# ? Aug 1, 2014 20:07 |
|
I just spent a couple days on the dumbest loving UICollectionView issue. I have a collection view with a custom layout that displays its contents in a horizontally paged grid. Depending on the number of elements in the whole thing, there might be blank space left over on the last page. Did you know that if you have a collection view with backgroundColor set to [UIColor clearColor], touching the blank area to start scrolling doesn't work? Only if you touch one of the cells. Likewise, setting a backgroundView with a clear background color causes the same problem. However, setting the background color to have alpha 0.01 causes scrolling to work again when touching in the empty area. Wtf, Apple
|
# ? Aug 2, 2014 03:03 |
|
Flobbster posted:Wtf, Apple It's not so for a class designed mainly to lay items out in potentially arbitrary positions to pass through touches outside its cells/reusable views by default, if you ask me. Eating touches in empty spaces sounds like it would be a pain in the rear end to get rid of if you needed those touches elsewhere, whereas it's relatively easy to use your aforementioned solutions to eat them.
|
# ? Aug 2, 2014 03:14 |
|
I can definitely see how it would be useful in some cases -- especially if someone was using a sparse collection view overlaying other interactive views underneath. Ease of workaround doesn't excuse the fact that from an API design point-of-view, using background color to control interactivity is a *really* bad code smell, and the workaround being to use an almost-but-not-quite-completely-transparent color is even more jacked up. I'd rather have something like collectionView.forwardsBackgroundTouchesToTheViewsThatYouCanSeeBehindIt = YES.
|
# ? Aug 2, 2014 03:29 |
|
Flobbster posted:I just spent a couple days on the dumbest loving UICollectionView issue. I have a collection view with a custom layout that displays its contents in a horizontally paged grid. Depending on the number of elements in the whole thing, there might be blank space left over on the last page. Views with an alpha of 0.0 are removed from the responder chain, I think. Maybe you should use the backgroundView property of the collection view to show whatever it is that is behind the collection view.
|
# ? Aug 2, 2014 03:45 |
|
Flobbster posted:I just spent a couple days on the dumbest loving UICollectionView issue. I have a collection view with a custom layout that displays its contents in a horizontally paged grid. Depending on the number of elements in the whole thing, there might be blank space left over on the last page. For future reference, I think this is the relevant part of the documentation: UIView Class Reference: -hitTest:withEvent: posted:
0.01 was a good guess!
|
# ? Aug 2, 2014 03:58 |
|
Welp, I didn't realize this was something that applied to all views. Thanks for pointing it out in the doc; I've read hitTest:withEvent: before but I guess I never internalized that part. That's a tidbit I'll never forget now. It's a custom keyboard extension so I need whatever blurred effect iOS puts underneath to show through, so 0.01 will work well enough -- no background view necessary.
|
# ? Aug 2, 2014 05:23 |
|
I think it's pretty crappy to tie presentation to event processing, as an API choice. It's not hard to have the owner specify that they want the view to be hit-transparent, and way clearer for that to be the case. It's nice that it's documented (though AFAIK not near the places that control alpha-I-mean-alpha-and-event-targeting), but that's sort of a blame-the-user thing. Too much magic.
|
# ? Aug 2, 2014 05:34 |
|
Subjunctive posted:I think it's pretty crappy to tie presentation to event processing, as an API choice. It's not hard to have the owner specify that they want the view to be hit-transparent, and way clearer for that to be the case. It's nice that it's documented (though AFAIK not near the places that control alpha-I-mean-alpha-and-event-targeting), but that's sort of a blame-the-user thing. Too much magic. Yeah, I forgot about the alpha-hit-test stuff. It does come in handy, though, when animating things nontrivially from hidden to not hidden or vice versa. I imagine that hits some unhappy corner cases when animating alpha using additive animations - it probably gets tricky to figure out when to call completion blocks and set hidden = YES or NO.
|
# ? Aug 2, 2014 05:54 |
|
For what it's worth this is merely the default implementation of hit testing, and there is no problem whatsoever doing with something else in your subclasses of UIView. By all means subclass UICollectionView and return self whenever super returns nil. It doesn't seem unreasonable on its face to, by default, prevent views from receiving touches when they are utterly imperceptible to the user. I can see why that might be surprising or unwanted behavior, and it is perhaps poorly documented, but it's a defensible decision in my view (lol) and it is easily overridden. Finally, I couldn't find any indication that views with an alpha of 0 are excluded from the responder chain, but I admit that I did not try very hard, and a simple example project would quickly answer that question. I'll give it a go tomorrow. pokeyman fucked around with this message at 06:30 on Aug 2, 2014 |
# ? Aug 2, 2014 06:26 |
|
Doctor w-rw-rw- posted:Yeah, I forgot about the alpha-hit-test stuff. It does come in handy, though, when animating things nontrivially from hidden to not hidden or vice versa. I imagine that hits some unhappy corner cases when animating alpha using additive animations - it probably gets tricky to figure out when to call completion blocks and set hidden = YES or NO. Animating views sets their userInteractionEnabled to NO by default, so that isn't really helped by hit testing considering transparency, but of course everything you mention comes into play when keeping interaction enabled during animation.
|
# ? Aug 2, 2014 06:29 |
|
pokeyman posted:Animating views sets their userInteractionEnabled to NO by default, so that isn't really helped by hit testing considering transparency, but of course everything you mention comes into play when keeping interaction enabled during animation. Before Facebook's Pop library came out, I was actually using UIViewAnimationOptionAllowUserInteraction quite a bit on some UIs to make them feel responsive, so it's not totally weird.
|
# ? Aug 2, 2014 07:42 |
|
Flobbster posted:Thanks, I'll look into that -- it looks like UIFontDescriptorCharacterSetAttribute and matchingFontDescriptors... do what I need. Oh man. You're building the exact same thing as I am (and running into the same problems)
|
# ? Aug 2, 2014 15:36 |
|
Ender.uNF posted:Are you drawing to the center point of each pixel (x+0.5) or directly on it? My first guess is maybe interpolation artifacts. Thanks for the help. I was not drawing the center of the pixel. I decided to try drawing into my own buffer as you suggested and then displaying that to the screen and that seems to fix the problem. I started with: code:
code:
The only way I could get it to work is by malloc'ing a persistent buffer I draw into and then creating a new NSBitmapImageRep every frame (with initWithBitmapDataPlanes:NULL because passing my buffer directly causes a crash) and then memcpy my buffer into the one returned by [nsImage bitmapData] for every frame. I'm sure the format of my data is correct because the memcpy method works, so it must be something with how I'm creating or re-using the NSBitmapImageRep.
|
# ? Aug 2, 2014 23:09 |
|
Ninja Rope posted:Thanks for the help. I was not drawing the center of the pixel. I decided to try drawing into my own buffer as you suggested and then displaying that to the screen and that seems to fix the problem. I started with: I would have created it with CGImageCreate or CGBitmapContextCreate which is supposed to support modifying the bitmap data via the pointer from CGBitmapContextGetData. I haven't fooled around with Core Graphics drawing in a little while though so someone who has done it more recently would probably have better advice.
|
# ? Aug 4, 2014 05:51 |
|
Ender.uNF posted:I would have created it with CGImageCreate or CGBitmapContextCreate which is supposed to support modifying the bitmap data via the pointer from CGBitmapContextGetData. I haven't fooled around with Core Graphics drawing in a little while though so someone who has done it more recently would probably have better advice. This is working exactly as you described and solves my problem. Thanks!
|
# ? Aug 4, 2014 22:55 |
|
My math game just got approved, and since I learned most of what I know from reading this thread, here's a bunch of codes:code:
|
# ? Aug 6, 2014 17:25 |
|
Lumpy posted:
Taken. Looks pretty neat! Clean design. The signs' color is a bit too weak, though - trying it out on my iPad in the shade at the train station, the gray is barely perceptible, and the sound is pretty soft, though audible at max volume. Also, the ready button should glow or slightly scale up and down between 95% and 105% IMO, or whatever looks good, to suggest that it wants to be interacted with and pressed to continue. Also, any technical details? What libraries did you use to build it? What techniques did you apply / learn / create? EDIT: Also, you might want to animate numbers towards the operator they bind more closely to, for order of operations. Example: EDIT 2: and a reset button as well. EDIT 3: and a training wheels mode where the intermediate result of two numbers and their operator are shown above. Doctor w-rw-rw- fucked around with this message at 17:41 on Aug 6, 2014 |
# ? Aug 6, 2014 17:32 |
|
Lumpy posted:
Mine!
|
# ? Aug 6, 2014 17:52 |
|
I took YPLX4T4FMYWA, thanks very much!
|
# ? Aug 6, 2014 17:56 |
|
Thanks for the feedback! We are having to rush out a fix for some Game Center stuff (it never showed up in testing, honest!) so I will try and sneak in some changes as well based on your suggestions. I was originally going to have the Ready pulse, but every person we had test (including a bunch of 6 year-olds) immediately tapped on it, so I left that out. Certainly wouldn't hurt to add it though! As for technology, we used the Pop library for animations, and uh, probably some other stuff . I tried hard to *not* code too much on this one, although I did the UI animations and some other bits and pieces. Lessons learned we many, but mostly from a working relationship perspective with my partner on the app.
|
# ? Aug 6, 2014 18:20 |
|
Lumpy posted:Thanks for the feedback! We are having to rush out a fix for some Game Center stuff (it never showed up in testing, honest!) so I will try and sneak in some changes as well based on your suggestions. I was originally going to have the Ready pulse, but every person we had test (including a bunch of 6 year-olds) immediately tapped on it, so I left that out. Certainly wouldn't hurt to add it though! Lumpy posted:As for technology, we used the Pop library for animations, and uh, probably some other stuff . I tried hard to *not* code too much on this one, although I did the UI animations and some other bits and pieces. Lessons learned we many, but mostly from a working relationship perspective with my partner on the app.
|
# ? Aug 6, 2014 18:24 |
|
Lumpy posted:7LRAPYYMMFYR Taken, thanks! I'll take a look! Edit: In survival mode, you wrote "Harde...". It's "Hard" Also, in survival mode, you don't stop the clock when swapping puzzles, and it takes about as long as the "correct" and swap animations take. Kind of annoying. Volmarias fucked around with this message at 18:54 on Aug 6, 2014 |
# ? Aug 6, 2014 18:46 |
|
Doctor w-rw-rw- posted:Hmm, good datapoint. Add a 5-second delay before it starts pulsing. I used 4.5 Issues w/ game center is fixed, Ready pulses, and I think I might try my luck at an expedited review.
|
# ? Aug 6, 2014 18:49 |
|
Lumpy posted:Issues w/ game center is fixed, Ready pulses, and I think I might try my luck at an expedited review. Just for game centre fixes? It's not stopping anyone from using the app, is it? Might want to save that for a lovely crash-on-launch bug or something.
|
# ? Aug 6, 2014 19:57 |
|
Is anyone successfully using CI to build / package release iOS apps? It seems that apple makes it loving impossible. If you are please share any good, recent guides on how you get there.
|
# ? Aug 6, 2014 20:15 |
|
wwb posted:Is anyone successfully using CI to build / package release iOS apps? It seems that apple makes it loving impossible. If you are please share any good, recent guides on how you get there. I haven't done it myself but here's something for Travis CI. What CI are you using?
|
# ? Aug 6, 2014 20:25 |
|
What problems are you running in to? It isn't particularly difficult other than that all of your options for server hardware are dumb.
|
# ? Aug 6, 2014 20:25 |
|
Lumpy posted:I used 4.5 Hey, so one bug is you preempt music that's playing on the device. Just starting the app cuts off playback, and your sounds will pause/unpause music. You should be using a different AVAudioSession category like AVAudioSessionCategoryAmbient. Also seconding reset button somewhere.
|
# ? Aug 6, 2014 21:47 |
|
The build server is TeamCity, the agent is running on a mac mini. Build is executing via ssh using a script. I should note the project is a phone gap app so I'm dealing with a generated xcode project, not something someone can queue up fixes into. Thanks for the travis CI link -- I can see where we are going wrong in one place -- we tried shipping the keychain rather than loading certificates into a temporary keychain and that is blowing up because apparently apple needs something to approve the use of the key. The more fundamental issue is that, in the raw, the build dies because there is something about schemes that gets setup when you open a project in xcode. So when I run xcodebuild it just times out after 10 seconds. Now if I open the project it will get to the point where it is dying on code signing which is surmountable. In either case it is amazing the difference between this and android where it just works if you feed it the right keystore with the right passwords.
|
# ? Aug 6, 2014 21:51 |
|
Speaking of stopping audio when starting, I finally found and fixed my bug with that - it turns out that I was calling prepareForPlayback in the init method of an object that one of my view controllers makes. That was preemptively starting my audio session and stopping everyone else. I only figured this out by following the apple bug report guidelines of making a small test app and noting that it worked there, then setting break points everywhere to see that hey, what do you know, didFinishLaunchingWithOptions is not even close to the first bit of my code that gets called on startup.
|
# ? Aug 6, 2014 21:53 |
|
ultramiraculous posted:Hey, so one bug is you preempt music that's playing on the device. Just starting the app cuts off playback, and your sounds will pause/unpause music. You should be using a different AVAudioSession category like AVAudioSessionCategoryAmbient. Thanks for the heads up, fixing that now. What would 'reset' do? Remove the operands, or switch to a new puzzle (in Endless mode)?
|
# ? Aug 6, 2014 21:57 |
|
|
# ? Jun 6, 2024 05:49 |
|
Lumpy posted:What would 'reset' do? Remove the operands, or switch to a new puzzle (in Endless mode)? It would remove the operators, not the operands. You could hide it until there's 2 or more operators (maybe 3), but it's a pain in the butt when you just want to retry placing the operators.
|
# ? Aug 6, 2014 22:10 |