For targets built to iOS9 in Xcode 7: NULL CGContext on startup in -[UIStatusBarBatteryItemView contentsImage] if UIViewControllerBasedStatusBarAppearance is set to false

Originator:hamish
Number:rdar://22517723 Date Originated:01-Sep-2015 02:41 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 9
Classification:Serious Bug Reproducible:Always
 
Hamish Allan01-Sep-2015 02:41 PM

Summary:
Stack trace:

#0	0x0000000183264ddc in CGPostError ()
#1	0x0000000183264d60 in handle_invalid_context ()
#2	0x000000018855fdc8 in -[UIStatusBarBatteryItemView contentsImage] ()
#3	0x000000018851b450 in -[UIStatusBarItemView updateContentsAndWidth] ()
#4	0x0000000188528ef4 in -[UIStatusBarItemView initWithItem:data:actions:style:] ()
#5	0x0000000188528c80 in +[UIStatusBarItemView createViewForItem:withData:actions:foregroundStyle:] ()
#6	0x0000000188528a50 in -[UIStatusBarLayoutManager _createViewForItem:withData:actions:] ()
#7	0x00000001884c2ee8 in -[UIStatusBarLayoutManager _prepareEnabledItemType:withEnabledItems:withData:actions:itemAppearing:itemDisappearing:] ()
#8	0x00000001884c2d24 in -[UIStatusBarLayoutManager prepareEnabledItems:withData:actions:] ()
#9	0x00000001884c2b50 in -[UIStatusBarForegroundView _setStatusBarData:actions:animated:] ()
#10	0x00000001884c25e0 in -[UIStatusBarForegroundView setStatusBarData:actions:animated:] ()
#11	0x0000000188ad5a18 in __51-[UIStatusBar _prepareToSetStyle:animation:forced:]_block_invoke ()
#12	0x00000001884dd10c in +[UIView(Animation) performWithoutAnimation:] ()
#13	0x0000000188ad5464 in -[UIStatusBar _prepareToSetStyle:animation:forced:] ()
#14	0x0000000188ad4560 in -[UIStatusBar _requestStyleAttributes:animationParameters:forced:] ()
#15	0x0000000188ad41e4 in -[UIStatusBar requestStyle:animationParameters:forced:] ()
#16	0x0000000188ad3f48 in -[UIStatusBar requestStyle:animated:forced:] ()
#17	0x000000018853db70 in -[UIStatusBar _evaluateServerRegistration] ()
#18	0x00000001884c934c in __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke ()
#19	0x00000001884c9020 in -[UIView(Hierarchy) _postMovedFromSuperview:] ()
#20	0x00000001884d63ac in -[UIView(Internal) _addSubview:positioned:relativeTo:] ()
#21	0x000000018853dea4 in -[UIStatusBarWindow setStatusBar:] ()
#22	0x000000018853cbe8 in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] ()
#23	0x000000018876fe58 in -[UIApplication _runWithMainScene:transitionContext:completion:] ()
#24	0x000000018876d2e8 in -[UIApplication workspaceDidEndTransaction:] ()
#25	0x000000018ca3b7ec in -[FBSSerialQueue _performNext] ()
#26	0x000000018ca3bb6c in -[FBSSerialQueue _performNextFromRunLoopSource] ()
#27	0x0000000182f750dc in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#28	0x0000000182f74b70 in __CFRunLoopDoSources0 ()
#29	0x0000000182f72870 in __CFRunLoopRun ()
#30	0x0000000182ea18a0 in CFRunLoopRunSpecific ()
#31	0x000000018853b1ec in -[UIApplication _run] ()
#32	0x00000001885360d4 in UIApplicationMain ()
#33	0x00000001000ed8c4 in main at /Users/hamish/Projects/QSX.master/QSX/main.m:20
#34	0x0000000197f268b8 in start ()

Steps to Reproduce:
1. Create new project in Xcode 7
2. Set UIViewControllerBasedStatusBarAppearance to "false" in Info.plist

Expected Results:
Runs without problem.

Actual Results:
Runs with following problem:

<Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.


Version:
iOS 9

Notes:


Configuration:
iPad mini retina, iPhone simulator

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!