|
Doc Block posted:Your loadView doesn't seem to call [super loadView]. Call it at the top of your loadView. You shouldn't call super when implementing your own loadView. You shouldn't even override it at all if using nibs, but that doesn't seem to be the case here. Just don't call super. dc3k fucked around with this message at 04:46 on Jan 16, 2015 |
# ? Jan 16, 2015 04:44 |
|
|
# ? Jun 7, 2024 07:49 |
|
Really? I thought you were supposed to call super's loadView, but the only time I've ever overridden loadView was when creating the UI in code (so, like, one time). I'll have to check and see if I called super's loadView.
Doc Block fucked around with this message at 07:41 on Jan 16, 2015 |
# ? Jan 16, 2015 07:37 |
|
chimz posted:That's a low memory log - the OS has run out of memory and had to kill a visible app to keep the system alive. When it does this, it logs out the memory usage of the system daemons and the app so you (and Apple) can see where memory was being used. Sure. TheReverend posted:I'm getting the following message: You need to add the constraints to a view such that the subtree rooted at that view contains all of the views mentioned in the constraints. Put another way, a constraint can only refer to views deeper in the hierarchy (and the view it's added to, of course). In your code, the constraints refer to both the toolbar and its superview (the | means "superview"), so you need to add the constraints to a view whose hierarchy contains both of those. Try adding the constraints to the toolbar's superview instead: Objective-C code:
Doc Block posted:Really? I thought you were supposed to call super's loadView, but the only time I've ever overridden loadView was when creating the UI in code (so, like, one time). I'll have to check and see if I called super's loadView. UIViewController Class Reference posted:You can override this method in order to create your views manually. If you choose to do so, assign the root view of your view hierarchy to the view property. The views you create should be unique instances and should not be shared with any other view controller object. Your custom implementation of this method should not call super.
|
# ? Jan 16, 2015 08:32 |
|
pokeyman posted:
I just checked the one case where I overrode -loadView, and LOL it calls [super loadView] first and then just sets about adding views to self.view, but never sets self.view. My guess is that it works because UIViewController's implementation of -loadView just creates an empty view and assigns it to self.view, which is why my terrible code worked. Really guys, I'm not an idiot. Promise. Doc Block fucked around with this message at 10:12 on Jan 16, 2015 |
# ? Jan 16, 2015 10:07 |
|
Doc Block posted:Really guys, I'm not an idiot. Promise. I would say it was a reasonable assumption to call super, since in most cases you do need to call it on lifecycle methods.
|
# ? Jan 16, 2015 16:09 |
|
I've been doing this for 2 1/2 years and I've never overridden loadView. I just do all of that in viewDidLoad. Sue me.
|
# ? Jan 16, 2015 18:54 |
|
That's valid. I think the idea is to have an overridden loadView be the equivalent of a nib, and then viewDidLoad is stuff you'd run regardless of how the view hierarchy was constructed. But any given view controller probably always gets its view hierarchy the same way every time, in which case the loadView/viewDidLoad distinction is really only useful for organizing your code. Personally, I prefer keeping view construction in loadView so that viewDidLoad is less cluttered, and so that an overridden loadView acts as a "DON'T BOTHER LOOKING FOR A NIB FILE" sign. A related idea is overriding updateViewConstraints I suppose, though you need be more careful here as that one might actually get called more than once.
|
# ? Jan 16, 2015 19:24 |
|
loadView to create the view hierarchy, viewDidLoad to do additional init
dc3k fucked around with this message at 20:41 on Jan 16, 2015 |
# ? Jan 16, 2015 20:31 |
|
gently caress this is driving me nuts. I am trying to figure out where a tableView header is (origin.y) on the view. I am using the following to get the rect for the header section:code:
I'm missing something stupid but I can't figure it out what it might be.
|
# ? Jan 16, 2015 21:33 |
|
Just-In-Timeberlake posted:gently caress this is driving me nuts. I am trying to figure out where a tableView header is (origin.y) on the view. I am using the following to get the rect for the header section: Not sure, but that suggests to me that its transform property is what's causing it to stick to the top if its origin actually changes.
|
# ? Jan 16, 2015 21:42 |
|
Swift frameworks are killing me right now. I have a workspace containing a framework project with mixed Swift and Obj-C. My app target uses the framework. I can't get it to run without adding the framework to Embedded Binaries. If I don't include it, it will build but complain about the library missing at runtime, naming my framework. That framework file lives in my derived data folder, so when anyone tries to collaborate with me, they have to change the reference to whatever the folder is called on their machine. I have tried using $(BUILT_PRODUCTS_DIR) to reference the folder, but I can't figure out how to reference the *framework's* products instead of my app project's folder. What am I missing? Surely Xcode has better ways of composing a library project and an app project that are intended to be worked on and built in parallel.
|
# ? Jan 19, 2015 21:28 |
|
fleshweasel posted:Swift frameworks are killing me right now. I have a workspace containing a framework project with mixed Swift and Obj-C. My app target uses the framework. I can't get it to run without adding the framework to Embedded Binaries. If I don't include it, it will build but complain about the library missing at runtime, naming my framework. My basic strategy with this is to smash it with a hammer until it mysteriously starts working.
|
# ? Jan 20, 2015 00:06 |
|
fleshweasel posted:Swift frameworks are killing me right now. I have a workspace containing a framework project with mixed Swift and Obj-C. My app target uses the framework. I can't get it to run without adding the framework to Embedded Binaries. If I don't include it, it will build but complain about the library missing at runtime, naming my framework. You're right, there is a better way. Finding it might be annoying. Try creating a new Xcode app project, then add a new Framework target to it and tick the box that says "embed in application". Confirm that it works, then compare the new project's build configuration and build settings with your malfunctioning one.
|
# ? Jan 20, 2015 01:42 |
|
Just added in some Swift code to an existing project. IPA just jumped up 9+ megs
|
# ? Jan 20, 2015 17:24 |
|
I just want to make sure I understand what this guy is talking about making NSMutableArray's run fast: http://stackoverflow.com/questions/6266350/how-can-nsarray-be-this-slow Down near the bottom of Rob Napier's answer, he mentions: quote:Try swapping out these lines for their obvious counterparts: He's saying to replace v with an NSMutableArray initialization and enumerate through it, right?
|
# ? Jan 20, 2015 18:11 |
|
Doh004 posted:Just added in some Swift code to an existing project. IPA just jumped up 9+ megs Probably because it's adding in the Swift runtime.
|
# ? Jan 20, 2015 19:09 |
|
LP0 ON FIRE posted:
nooooooooooooooo EDIT: NSArray is a pretty high-overhead container, especially for storing primitive values; the most surprising thing about this guy's post is that it's as close as it is. Probably they're capturing a lot of fixed overhead in their measurements. rjmccall fucked around with this message at 19:43 on Jan 20, 2015 |
# ? Jan 20, 2015 19:40 |
|
It's from 2011, so yeah, no @(j) syntax. The OP is even manually calling dealloc, though, so it's not the best code. And, as somebody else in that thread mentioned, these kind of micro benchmarks don't reflect real world usage very well and aren't all that useful.
|
# ? Jan 20, 2015 20:27 |
|
Doc Block posted:It's from 2011, so yeah, no @(j) syntax. The OP is even manually calling dealloc, though, so it's not the best code. +numberWithInt existed in 2011. So did tagged pointers (although just barely in that case).
|
# ? Jan 20, 2015 20:30 |
|
I'm still kind of confused what point he's trying to make. His tests show:quote:Vector insertions So I'm guessing Non-retaining is an NSMutableArray that's not allocated? Anyway, I was trying to look up why NSMutableArray could be slow, and I eventually found that it was a lot of replaceObjectAtIndex's that didn't need to be there executing most of the time. Regardless I'm surprised how much of an impact it made.
|
# ? Jan 20, 2015 21:39 |
|
std::vector is hyperoptimized for efficient storage size, access, and iteration, with the price that basically every structural modification except pushing to and popping from the end is inefficient. It'd be an extreme choice, except that's actually a perfectly acceptable set of tradeoffs for 95% of list-manipulation code (and most of the rest is using a single-ended queue when a stack would be totally acceptable). There are more balanced list implementations which support a broader set of efficient modifications, at some cost to storage size, access, iteration, etc. The standard NSArray is pretty far out on this extreme, but Rob Napier's example really only needs efficient front-insertion to beat std::vector. And it's fair to say that front-insertion is something that comes up enough in UI programming that NSArray supporting it efficiently is a real plus. Of course, a lot of the performance impact of NSArray is not in the choice of data structure; it's just pure overhead. Meanwhile, std::vector may not provide efficient front-insertion, but std::deque does, and it generally makes a lot of the same tradeoffs as NSArray. Overall, you have to trust programmers to make intelligent choices about data structures when it actually matters, because (1) many programmers do make good decisions and (2) the ones who don't will find some way to screw over your performance anyway. But you can't stop people from making microbenchmarks to prove dumb points.
|
# ? Jan 21, 2015 00:05 |
|
The way Apple implements CFArray is one of the things I love about Apple. source The answer to "How is an array implemented in Objective-C?" is basically "Don't worry your pretty little head about it."
|
# ? Jan 21, 2015 01:13 |
|
Doctor w-rw-rw- posted:Probably because it's adding in the Swift runtime. Oh I know, I did some sniffing around the archive. Was still just a bit surprised is all.
|
# ? Jan 21, 2015 04:47 |
|
pokeyman posted:You're right, there is a better way. Finding it might be annoying. I think I figured it out. I have to: 1. create a reference to my library project in my app project by dragging one into the other. 2. Then in build stages(?) for my app target I add the inner project as a dependency. 3. Then I can go to Embed Frameworks and embed it and it will have a relative path.
|
# ? Jan 21, 2015 21:58 |
|
So I've got this search bar controller that when you click on the text field you can see the modal overlay extend over the search bar (goes about 1/2 way over the navigation bar) and when you type in it the results table just covers the whole search bar. What loving setting do I need to be looking at to make it look the way it should, I can't find anything on Google.
|
# ? Jan 22, 2015 17:00 |
|
Question about didReceiveMemoryWarning. It happened to me today on the Ipad Air 2. Now I've been working on my application and testing new features on it all day, etc. In the simulators it never shows up but in the actual device debugging it did. I used the leaks instrument but didn't see anything (but then again it's my first time using it so what do I know). I restarted the Ipad and now everything is working fine. No warnings etc. How critical are these warnings? Do they sometimes show up without any real problems? I'm making all efforts to use ARC properly. so I was a little surprised and worried to see it.
|
# ? Jan 22, 2015 21:51 |
|
You could have a memory leak, or you could just be using a lot of memory at a time when the device is running low. Trying playing around with your app with the Leaks instrument turned on; it's normal to see some growth up to a steady state, but if the app's memory just keeps gradually growing the more you use it, that's something you need to take care. It's not too surprising that the simulator didn't send you a memory warning; the simulator is really just running on your Mac, which is a pretty different environment with a lot more available memory. However, running in the simulator should be perfectly fine for analyzing your memory use with Leaks; you don't need to actually run out of memory, you just need to see how much memory you're using. ARC protects you from most kinds of memory leak, but there's a very important exception: ARC can't automatically break cycles of strong references. Leaks is pretty good at helping you find those, though.
|
# ? Jan 22, 2015 22:04 |
|
I am finishing up an app for a customer doing some enterprise-y type work and we are starting to talk actual deployment. If the application requires a login to work as well as specific password (that was the customer's request) can I distribute through the app store so that our users nation wide can just buy iPod touches without too much hassle? I thought about looking for a cheap MDM solution, but think that is too much hassle for devices meant for one thing. Dirk Pitt fucked around with this message at 03:00 on Jan 23, 2015 |
# ? Jan 23, 2015 02:56 |
|
TheReverend posted:Question about didReceiveMemoryWarning. As long as your app's memory usage is under control (no leaks and you aren't being super wasteful), a lone memory warning every so often isn't a big deal. Your app will get a low memory warning any time the system runs low, even if your app isn't isn't a memory hog. They're usually caused by a lot of apps being open in the background, and iOS will prune the open background apps if it needs more memory (starting with the least recently used ones) before it resorts to killing the foreground app. When your app does get a memory warning, use the opportunity to free up anything you can, within reason, and only get concerned if your app consistently gets multiple memory warnings. And as others have mentioned, you can always run your app through the Leaks instrument, and the clang static analyzer will help if it turns out you do have a memory leak. Doc Block fucked around with this message at 09:23 on Jan 23, 2015 |
# ? Jan 23, 2015 09:20 |
|
And, judging by my recent history in this thread (see: the top of this page) now comes the part where my post was completely wrong LOL
|
# ? Jan 23, 2015 09:28 |
|
Good tips.Doc Block posted:And, judging by my recent history in this thread (see: the top of this page) now comes the part where my post was completely wrong LOL
|
# ? Jan 23, 2015 10:18 |
|
Dirk Pitt posted:I am finishing up an app for a customer doing some enterprise-y type work and we are starting to talk actual deployment. If the application requires a login to work as well as specific password (that was the customer's request) can I distribute through the app store so that our users nation wide can just buy iPod touches without too much hassle? Are all the users employees of your customer company? If so, you can also just get an enterprise certificate for $299 instead of $99. You can sign the builds with the enterprise certificate, and they can be loaded onto the phone without the App Store and without UDID registration. Then just set up a web portal whereby you can download the app. Here's a quick guide on how to craft a web page that lets you download the .ipa onto a device and install over the air. http://aaronparecki.com/articles/2011/01/21/1/how-to-distribute-your-ios-apps-over-the-air You can also just use Apple Configurator to put together a canned config profile for the iPod touches too that includes the app, but I haven't done that before to really comment on the procedure.
|
# ? Jan 23, 2015 16:34 |
|
I wish I could banish every iPad 3 to hell, but optimizing for it makes for a better, snappier experience for everyone. Still, what a piece of junk.
|
# ? Jan 23, 2015 16:40 |
|
TheReverend posted:Question about didReceiveMemoryWarning. So beaten, but wanted to point out that if the system is running low on memory (due to background apps kicking off or whatever) you can get a memory warning despite not leaking and not using much memory. You can use stuff like NSCache to help you; it automatically responds to memory warnings by dumping items from the cache. I believe UIKit now automatically handles dumping and recreating offscreen views as well (can anyone confirm that?) Use the Simulator's menu item to "Simulate memory warning". Usually uncovers at least one or two bugs in most apps! Dirk Pitt posted:I am finishing up an app for a customer doing some enterprise-y type work and we are starting to talk actual deployment. If the application requires a login to work as well as specific password (that was the customer's request) can I distribute through the app store so that our users nation wide can just buy iPod touches without too much hassle? Others have pointed out you can do Enterprise, but the enterprise cert is only for employee devices. There's also the B2B store if you are distributing just to other companies that are your direct customers. For the main app store (which has the lowest friction), just create a test account and give that info to app review in the review notes section and they'll login. It's not a problem, I've done this myself for an app that required you buy a whole other app and install it on your windows servers. I just ran a VM with test data and gave app review the details.
|
# ? Jan 23, 2015 20:58 |
|
Ender.uNF posted:Others have pointed out you can do Enterprise, but the enterprise cert is only for employee devices. edit: I was drawing an imaginary distinction between what you said and the rule. My example was still "employee devices." Specifically, I've heard from Apple that the devices have to be under company control. That doesn't necessarily mean company owned. ManicJason fucked around with this message at 21:22 on Jan 23, 2015 |
# ? Jan 23, 2015 21:18 |
|
kitten smoothie posted:Are all the users employees of your customer company? If so, you can also just get an enterprise certificate for $299 instead of $99. You can sign the builds with the enterprise certificate, and they can be loaded onto the phone without the App Store and without UDID registration. Thanks, our situation is weird. My customer is the software vendor, her customers will be the ones buying iPod touches to issue to devices. Ender.uNF posted:
I think I am going to look at option 2 and 3. It would be nice to have another app to point potential customers too in a publicly accessible app store.
|
# ? Jan 23, 2015 21:30 |
|
lord funk posted:I wish I could banish every iPad 3 to hell, but optimizing for it makes for a better, snappier experience for everyone. Seriously, developing for the shittiest device really amplifies the inefficiencies in your app and lets you target them. That's why I'm glad I tested my app quite a bit on iPhone 4.
|
# ? Jan 24, 2015 22:58 |
|
I was so happy to discover that my collectionview newsfeed performed super duper well on the 4s. Hadn't tested it out until showing the application to a friend who's still rocking one.
|
# ? Jan 24, 2015 23:09 |
|
I can't get Xcode to add a folder from the desktop. I've always done this. Make a new folder on the desktop, then drag it into Xcode's navigator. I chose Copy items if needed, Create groups, and have the correct target chosen. It showed up in the navigator the first time, but then I found there wasn't a physical folder associated with it in the Finder, so I deleted the folder in the navigator, and tried again. Now it does not show up in the navigator after I add it. No error messages. I've also tried choosing Create folder references. e: Also thank you rjmccall for the information, and ManicJason - that was a really good read!
|
# ? Jan 25, 2015 17:30 |
|
|
# ? Jun 7, 2024 07:49 |
|
I'm wondering if anyone's come across my situation. I've got an app (native OS X app that runs in X11 with a ton of external dependencies) that used to work fine in my old build system (migrated from Mavericks to Yosemite). When I got my new mac, I rebuilt all the externals from scratch and rebuilt the app which worked fine. However, I'm noticing today that ANY time the application needs to break because of a segfault or other exception while being debugged, it will crash Xcode with it...A cursory look at the crash dump for Xcode seems to indicate that there is a problem in the debugging thread while demangling some symbol: code:
(the top two functions of the trace repeat hundreds of times...notice the stack count). Anyone else seen this before? shodanjr_gr fucked around with this message at 21:37 on Jan 25, 2015 |
# ? Jan 25, 2015 21:30 |