Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
LP0 ON FIRE
Jan 25, 2006

beep boop
In iOS I'm having some baffling performance issues with CALayers, specifically a class method that returns a CAGradientLayer on a view's sublayer. At first I thought it was because I was getting too much overhead by drawing 1536x2048 pixels on the screen, but then I found if I load more images on top of that, most of the time this will trigger it to run like normal. It brings me to the conclusion that the OS must be dumping some kind of cache which raises performance again.

Is there anything I can do manually empty a cache or something?

I've also tried the following before it returns the layer with no effect:

code:
headerLayer.shouldRasterize = YES;

headerLayer.rasterizationScale=[UIScreen mainScreen].scale;

headerLayer.drawsAsynchronously = YES;

headerLayer.opaque = YES
The size of the layer's frame directly influences the performance when the layer is added. If I have it a quarter of the screen size, I have no animation smoothness problem. Another thing I thought of is maybe adding it small and stretching it out somehow? Not sure if that would improve anything, but I wouldn't care if it degraded the quality of the gradient.

Another thing to note, is I had no problem with this in iOS 6.

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



For those of us not at WWDC, videos are starting to show up:

https://developer.apple.com/videos/wwdc/2014/

xpander
Sep 2, 2004
I've got a dumb question that is probably easily answered. I have an app for an event that was originally developed for iOS 6, but due to reasons got rejected and did not get resurrected until this year. iOS 7 has that fullscreen view thing where it ignores the status bar, and thus all my views are appearing underneath it. I've tried countless suggestions via Google

I've got a Tab Bar Controller as my root view controller(using storyboards), nothing fancy here(other than having some code for recognizing gestures to go between views for the tabs). I've tried the following:

code:
if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
    self.edgesForExtendedLayout = UIRectEdgeNone;
}
and

code:
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
    [self prefersStatusBarHidden];
    [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
as well as adding in some plist entries:

code:
View controller-based status bar appearance: NO
Status bar is initially hidden: YES
I've also unchecked "Under Top Bars" in Interface Builder for each of the view controllers.

The best I've been able to do so far is hide the status bar and shift the view down 20px, but what I really want is one or the other, as it doesn't look great right now. Am I missing something obvious?

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do
Of relevance to this thread, apparently Apple has changed their NDA to be less restrictive on people discussing the APIs publicly. If I understand this correctly, we can discuss the new stuff in public forums, instead of just in the hidden Apple forums, right?

Hughlander
May 11, 2005

Anyone else running into this on Xcode 6 when running on a pre iOS8 device if CFNetwork is a required framework?
dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate

(See also http://stackoverflow.com/questions/24043532/dyld-symbol-not-found-nsurlauthenticationmethodclientcertificate-when-trying while not my question was the only google hit I found on it so far.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Running into an issue where ~sometimes~, a UITextView is not rendering the last line of its text; HOWEVER, if say I push a viewController onto the stack and pop it, reshowing the original viewController with the UITextView, the last line shows up correctly. Here's a gif of it happening:



The only thing that I could see why it's showing the last line successfully the second time it "appears" is I have this in the viewWillAppear (I've also tried in the viewDidAppear):

code:
        [_myTextView.layoutManager ensureLayoutForTextContainer:_myTextView.textContainer];
My thinking is that I'm ensuring the layout of the textContainer BEFORE the UITextView is actually rendered on the page but I'm not sure.

I'm also setting these two properties:
code:
    _myTextView.clearsContextBeforeDrawing = YES;
    _myTextView.layoutManager.allowsNonContiguousLayout = NO;
But that doesn't seem to help much. Any idea what's going on?

Doh004 fucked around with this message at 19:18 on Jun 6, 2014

lord funk
Feb 16, 2004

App Rejected for a background mode that shouldn't have been there in the first place. :/ I wonder how it got there.

Gul Banana
Nov 28, 2003

coming back to apple development after a long time, i'm stuck on how to debug this one issue. using Xcode 6 beta, i have an iOS 7 app which simply displays a UIImageView from an asset catalog. there's almost no code involved; the image is set in the .storyboard.

the image displays fine in the simulator, but not on my actual iPhone 4. stack overflow guesses it's a filename casing problem, but i've verified otherwise - and it seems like asset catalogs maybe obviate that issue anyway. trying to work out what's wrong, i've run into a few issues:

- i can't try going back to Xcode 5, as the app is written in swift
- i can't seem to use lldb, running "po outlet.image" at an appropriate breakpoint crashes xcode
- switching between images is extremely difficult to test even in the simulator. it requires me to manually delete the simulator's existing copy of the app every time.

when i do go through that, it seems with several test images (pngs, generated by photoshop or pixelmator..) the result is the same: a correctly displayed image in the simulator, and a background-coloured rectangle on the device. the rectangle *does* correctly size to the image which it should be, but is not, displaying. any thoughts? :(

Gul Banana
Nov 28, 2003

spoke too soon. i've "solved" my problem by configuring the simulator to run iOS 7.1 instead of 8.0; now it, like the device, cannot display any images.
i'd rather they both worked but consistency at least allows me to debug this.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Stop using a beta version if you're expecting consistency and minimal bugs.

Gul Banana
Nov 28, 2003

Doh004 posted:

Stop using a beta version if you're expecting consistency and minimal bugs.

my goal is to try swift. i am interested in finding bugs, not avoiding them. i already know how to create a working version of the same thing in objective-c using Xcode 5.

sadly, copying the iOS 7 sdk from Xcode 5 to Xcode 6 beta does not alleviate the problem. it builds fine - so that's promising for the swift runtime on older devices! - but the image still does not display, except in simulator running iOS 8.

perhaps it is the asset catalog packaging at fault..

PleasureKevin
Jan 2, 2011

I tried to sign up for a dev account but it had my name, state and country wrong, despite my Apple ID being right (they should be linked). So I did the reasonable thing and edited the hidden forms on the page to correct them. It let me pay but even though I signed up as an individual it says it's checking my references to make sure I represent my company. Pretty lame, but hopefully I can clear it up with support. Anyone have a similar issue?

WORLDS BEST BABY
Aug 26, 2006

Gul Banana posted:

my goal is to try swift. i am interested in finding bugs, not avoiding them. i already know how to create a working version of the same thing in objective-c using Xcode 5.

sadly, copying the iOS 7 sdk from Xcode 5 to Xcode 6 beta does not alleviate the problem. it builds fine - so that's promising for the swift runtime on older devices! - but the image still does not display, except in simulator running iOS 8.

perhaps it is the asset catalog packaging at fault..

Nothing's wrong with your asset catalog, I had the same issue with an app with a single swift class in it. All local images — even in views with classes written in objective-c — couldn't display images. It's definitely an issue with the Xcode 6 beta, so don't tear your hair out.

Gul Banana
Nov 28, 2003

man, that's a shame. I don't own an ios8-capable device, so I guess my test apps will be all text and transitions for now.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
So thoughtful of Crashlytics to add beta distribution! Does it count as being Sherlocked if Apple announces their version days before?

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

pokeyman posted:

So thoughtful of Crashlytics to add beta distribution! Does it count as being Sherlocked if Apple announces their version days before?

Yeah, I really didn't get this move. Both of the platforms Crashlytics services have their own beta distribution systems, and it's not exactly news (Apple buying Testflight was unofficially news back in February). It just seems weird to set up a bandwidth-intensive like this in the name of making a maybe-better implementation of Testflight.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Is anyone else finding Swift to be pretty slow? Some engineers I work with have been experimentally porting some tools from Node to Swift, and are seeing no-poo poo 10x or worse slowdowns. These are things that bang on XML trees and such, and take about a second to run under Node on a late-model MBP. One rdar has been opened for brutal dictionary access performance, but I'm wondering if this is consistent with others' experiences.

(Don't have code I can share at this point, but I think there's some in the rdar for Apple's benefit.)

bumnuts
Dec 10, 2004
mmm...crunchy
Is HomeKit iOS only? What happens if my lights are set to come on at sunset but I'm away all day and no iOS device is there to send the BTLE signal?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Subjunctive posted:

Is anyone else finding Swift to be pretty slow?

Did you try building it for Release with -Ofast?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Subjunctive posted:

Is anyone else finding Swift to be pretty slow? Some engineers I work with have been experimentally porting some tools from Node to Swift, and are seeing no-poo poo 10x or worse slowdowns. These are things that bang on XML trees and such, and take about a second to run under Node on a late-model MBP. One rdar has been opened for brutal dictionary access performance, but I'm wondering if this is consistent with others' experiences.

(Don't have code I can share at this point, but I think there's some in the rdar for Apple's benefit.)

There is a Swift thread if that helps.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Subjunctive posted:

Is anyone else finding Swift to be pretty slow? Some engineers I work with have been experimentally porting some tools from Node to Swift, and are seeing no-poo poo 10x or worse slowdowns. These are things that bang on XML trees and such, and take about a second to run under Node on a late-model MBP. One rdar has been opened for brutal dictionary access performance, but I'm wondering if this is consistent with others' experiences.

(Don't have code I can share at this point, but I think there's some in the rdar for Apple's benefit.)

That's not expected; I wonder if you're getting copies that you aren't expecting. We'll take a look at your bug for sure.

Doc Block
Apr 15, 2003
Fun Shoe
LOL at all the Ruby devs that learned Objective-C and are now acting like Swift is the second coming or something.

"Finally! We can write native apps in something that looks like our ugly web developer scripting language!"

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

eschaton posted:

Did you try building it for Release with -Ofast?

Yeah, it's all -Ofast.

rjmccall: if you want to PM me an address I can have the dev contact you with more detail. I think he's seeing a bunch of lock traffic, but I was just skimming the most recent comments.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Subjunctive posted:

rjmccall: if you want to PM me an address I can have the dev contact you with more detail. I think he's seeing a bunch of lock traffic, but I was just skimming the most recent comments.

It's just rjmccall@apple.com. I use it for open source commits, so it's out there; no point in hiding.

Lock traffic is an interesting hint; the places we use hard locks are definitely places we could easily improve things.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
Is there a way to download symbols for a version of iOS I don't have on any devices?

Haha, I already know there isn't. I wonder why Xcode only downloads symbols when a device is connected, and not when symbolicating a crash log

Hahaha, I already know why it doesn't. It's because the sophisticated "symbolicate" feature is a rinky dinky Perl script

e: and, coming from a long experience in Windows development, the obsequious respect for Apple, as found in the commonly expressed thought that "there isn't a way to download the symbols and you shouldn't even ask because it's unsupported" makes me sick

hackbunny fucked around with this message at 14:10 on Jun 10, 2014

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

hackbunny posted:

Is there a way to download symbols for a version of iOS I don't have on any devices?

Haha, I already know there isn't. I wonder why Xcode only downloads symbols when a device is connected, and not when symbolicating a crash log

Hahaha, I already know why it doesn't. It's because the sophisticated "symbolicate" feature is a rinky dinky Perl script

e: and, coming from a long experience in Windows development, the obsequious respect for Apple, as found in the commonly expressed thought that "there isn't a way to download the symbols and you shouldn't even ask because it's unsupported" makes me sick

You can't compare Microsoft's developer support to anyone else, including Apple. It just isn't in anyone else's DNA and part of the reason is Microsoft went out and acquired all the dev tools companies they could, or hired their best people away (e.g.: Anders Hejlsberg from Borland). So of course they support symbol servers and reference source; I can debug the Microsoft runtime, with full source code, by clicking a checkbox. However there are plenty of warts and BS on the Microsoft/VS side, we're just used to them. Try using nuget packages with install scripts... you'll find they won't actually run the scripts from the command line or a build server, making it useless as a package manager. Why? Because it depends on the VS EnvDTE COM component which is only available inside Visual Studio.

If you look at Apple's love letter to developers last week, it's apparent that they've been listening to all our complaining and they haven't been sitting still. I never though in a million years Xcode would add the ability for design-time controls in IB but they did and it works just like the VS designers and that's awesome. Swift, Extensions, CloudKit (aka so-long iCloud Core Data), recording screencaps directly from devices, etc. It shows Apple has been listening and they've been putting real resources into improving their development tools.

Toady
Jan 12, 2009

Ender.uNF posted:

I never though in a million years Xcode would add the ability for design-time controls in IB but they did and it works just like the VS designers and that's awesome.

Interface Builder 3 actually had a plugin API, but it was lost in the switch to Xcode 4.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
I'm writing an app that wants to play an alarm sound through silent mode even after I switch away from the app.

I have this specific feature working through a combination of local notifications with a sound attached (for when despite all my efforts, my app is terminated), and background audio, creating an audio session and playing a silent sound through it until it's time to play the alarm sound.

So far so good. But now that I've implemented this, I notice that when I open or switch to my app, it kills any other app that's playing music at the time, even if I'm not setting up to play an alarm. Ideally it wouldn't do that ever (or it would only when playing the alarm sound) but at the very least I don't expect it to happen when I'm not going to play an alarm.

I only open my audio session when I'm preparing to play an alarm, and I close it when I'm not. Is there something I'm missing?

edit: Okay, by setting the category in my didFinishLaunching method to AVAudioSessionAmbient I can at least avoid killing other apps' audio when switching to my already-running app, but it still does it on launch. I feel like there has to be a way to avoid it entirely.

edit 2: I've come to the compromise of just setting my session to AVAudioSessionPlayback with MixWithOthers in my launch method. If I'm going to kill audio in other apps, I might as well do it as little as possible.

Still looking for a way to not do it at all until the user asks for an alarm, though.

Dessert Rose fucked around with this message at 03:33 on Jun 11, 2014

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Dessert Rose posted:


edit 2: I've come to the compromise of just setting my session to AVAudioSessionPlayback with MixWithOthers in my launch method. If I'm going to kill audio in other apps, I might as well do it as little as possible.

Still looking for a way to not do it at all until the user asks for an alarm, though.

That's the correct way; Playback session and enable MixWithOthers:

code:
	NSError *audioError = nil;
	AVAudioSession *session = [AVAudioSession sharedInstance];
	if(![session setCategory:AVAudioSessionCategoryPlayback
                 withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&audioError]) {
        OSSLog(@"[AppDelegate] Failed to setup audio session: %@", audioError);
    }
    
    if(![session setActive:YES error:&audioError]) {
        OSSLog(@"Unable to set audio session active: %@", audioError);
    }
This shouldn't cause any problems or cause other app's audio to stop. Make sure your app has the audio stream required background mode.

Also sometimes iOS just loses track of your audio session when you're in the background and not playing any audio, so be sure to set the session category+options again when you get ready to kick off playback.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
I definitely cause other apps to stop playing audio on a fresh launch with that code and the audio UIBackgroundModes key. Maybe it's a bug?

Normy
Jul 1, 2004

Do I Krushchev?


I have a container view that holds controls to implement a timer on my app (start, stop, reset buttons and a label for the time). I have that container view on multiple views in my app. I'm having trouble setting it up so each view displays the same time and keeps counting down if the timer is running.

I'm thinking I need to make the container view into a singleton. Is that the right track? Does my question make any sense? Thanks I'm still very new to iOS.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Normy posted:

I have a container view that holds controls to implement a timer on my app (start, stop, reset buttons and a label for the time). I have that container view on multiple views in my app. I'm having trouble setting it up so each view displays the same time and keeps counting down if the timer is running.

I'm thinking I need to make the container view into a singleton. Is that the right track? Does my question make any sense? Thanks I'm still very new to iOS.

If the timer view's always in the same place on the screen, you could make your root view controller a custom container view controller, put your timer view where you like, then add your existing root view controller (tab bar controller, navigation controller, whatever) to your custom container. Then when you change tabs or push on to the navigation stack, the timer view just sits merrily on its own.

If you want to move the timer view around depending on where you're at in the app, I'd suggest having multiple views and supplying them with a common model. That is, don't make your view a singleton; make some model object a singleton instead.

I'm not sure how to implement either solution using storyboards (which I assume you are using) because I'm storyboard-inept. It might help if you could describe a bit more about your app. Are you using a tab bar controller? Navigation controller?

Normy
Jul 1, 2004

Do I Krushchev?


It's a Master-Detail View Controller. The Master is a TabController with 4 tabs and each tab has it's own DetailViewController. I have the TimerViewController on each of the DetailViewControllers in the same location.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Can you change the master to a custom view controller and put both the tab bar controller and the timer view controller therein?

Normy
Jul 1, 2004

Do I Krushchev?


Well I want the timer visible at all times. If it was on the master it would hide in portrait mode, right?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Oh, iPad app. Right. I'm not sure if you can usefully embed a split view controller into a custom container view controller. You could add the timer view to the split view controller's view I guess, then just make sure none of your other content underlaps.

There's always the comedy option of adding your timer view directly to the window.

Doh004
Apr 22, 2007

Mmmmm Donuts...
You can add a UISplitViewController to a custom container view controller.

lord funk
Feb 16, 2004

App release day! For those who have been hanging around here, I've been working on a MIDI / OSC controller app for the iPad. I don't know if there are any iOS musicians here, but here are some codes to check it out. I'm interested in what you guys think of the interface work. :)

https://vimeo.com/97844430

LXP7KA7MFTYP
EAFM7F4A977L
YLRXKHKMR3JM
N6FXKFMAP6NN
PLR3YPWFF79F

BennyGsGhost
Jun 27, 2002

Low P/B or Bust
Pillbug

lord funk posted:

App release day! For those who have been hanging around here, I've been working on a MIDI / OSC controller app for the iPad. I don't know if there are any iOS musicians here, but here are some codes to check it out. I'm interested in what you guys think of the interface work. :)

https://vimeo.com/97844430


Wow that looks amazingly cool! I'll leave the codes to the more musically inclined but the video makes it look fun as hell to use, nice work!

Adbot
ADBOT LOVES YOU

Doh004
Apr 22, 2007

Mmmmm Donuts...
Hey congratulations lord funk. I've always liked seeing your posts. I've never understood exactly what it is your app does but I always thought it looked cool :shobon:.

Shipping an app feels great. Now you get to have fun with all of the crash reports :D

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply