Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6751843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:58:31+00:00 2026-05-26T12:58:31+00:00

I have a strange situation in one view controller where this line crashes in

  • 0

I have a strange situation in one view controller where this line crashes in the iOS 5 simulator:

   // myTextField is created in a NIB
   myTextField.borderStyle = UITextBorderStyleNone;

It’s okay in the device (and both device and simulator on iOS 4.3). I’ve checked the connections in the NIB (even deleted and reconnected). myTextField has a retainCount of 2 at this point in the code. I’m setting other attributes (e.g., “text” and “userInteractionEnabled” prior to this point, and those do not cause a crash.

However, if I use this sequence, it does not crash:

   myTextField.borderStyle = 4; // not a defined border style
   myTextField.borderStyle = UITextBorderStyleNone;

If I use 1, 2, or 3 (defined styles) instead of “4” (an undefined border style), it crashes. “7” works.

In my other view controllers, I have similar textViews, and no problem setting the borderStyle to UITextBorderStyleNone.

Edit: Here’s the backtrace:

Thread 1, Queue : (null)
#0  0x01e0609b in objc_msgSend ()
#1  0x005c1c22 in -[UIView(Hierarchy) _setBackgroundColor:] ()
#2  0x005c3a06 in -[UIView(Rendering) setBackgroundColor:] ()
#3  0x0063eab7 in -[UITextField setBackgroundColor:] ()
#4  0x0063e1b6 in -[UITextField setBorderStyle:] ()
#5  0x000c23e6 in -[DutyEditViewController viewWillAppear:] at /Users/jeff/Applications/iPhone/MyApp/Classes/DutyEditViewController.m:197
#6  0x00651fbf in -[UIViewController _setViewAppearState:isAnimating:] ()
#7  0x0065221b in -[UIViewController __viewWillAppear:] ()
#8  0x006524c3 in -[UIViewController beginAppearanceTransition:animated:] ()
#9  0x00662b71 in -[UINavigationController _startTransition:fromViewController:toViewController:] ()
#10 0x006633df in -[UINavigationController _startDeferredTransitionIfNeeded] ()
#11 0x00663986 in -[UINavigationController pushViewController:transition:forceImmediate:] ()
#12 0x0c894dbd in -[UINavigationControllerAccessibility(SafeCategory) pushViewController:transition:forceImmediate:] ()
#13 0x006635a4 in -[UINavigationController pushViewController:animated:] ()
#14 0x000bf99a in -[DutiesTableViewController tableView:didSelectRowAtIndexPath:] ()
#15 0x0061a71d in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] ()
#16 0x0061a952 in -[UITableView _userSelectRowAtPendingSelectionIndexPath:] ()
#17 0x0025386d in __NSFireDelayedPerform ()
#18 0x020dc966 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#19 0x020dc407 in __CFRunLoopDoTimer ()
#20 0x0203f7c0 in __CFRunLoopRun ()
#21 0x0203edb4 in CFRunLoopRunSpecific ()
#22 0x0203eccb in CFRunLoopRunInMode ()
#23 0x0258a879 in GSEventRunModal ()
#24 0x0258a93e in GSEventRun ()
#25 0x0058aa9b in UIApplicationMain ()
#26 0x0006117d in main ()
#27 0x00002c65 in start ()

I notice that the setBorderStyle: is doing a setBackgroundColor:, so changed my code to this:

myTextField.backgroundColor = [UIColor clearColor];
myTextField.borderStyle = UITextBorderStyleNone;

and the crash no longer happens. But, the background color is being set to “Clear Color” in the NIB.

So, the crash is gone, but the mystery of why I must set the background color (even though the NIB is already doing that) remains.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:58:31+00:00Added an answer on May 26, 2026 at 12:58 pm

    Solved. It’s an iOS 5.0 bug, and it’s in iOS 5 on devices, too, not just the simulator. A crash will occur when setting the UITextField borderStyle property if the backgroundColor has been set using UIColor’s colorWithRed:green:blue:alpha:.

    There is no crash if the text field’s backgroundColor has been set using a preset color, e.g., clearColor. There is no crash if borderStyle is set to its current value.

    I’ve submitted a but report to Apple (Bug ID 10381834).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation similar to this one struct Child { u16 x, y;
Trying my hand with jQuery. I have this strange situation that i wish to
I have a strange situation with my web service. It is a simple one
This is strange: I have a view containing a rotated CALayer. The layer is
Strange situation. inside a solution I have several projects. One of them is called
I have a very strange situation. I have a large set of records to
I have this strange call stack and I am stumped to understand why. It
We have very strange problem, one of our applications is continually querying server by
I have this strange issue with my web app. You see, I'm using jQuery
We have a strange situation where we lose a Stateless SessionBean in a Bean

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.