[[UITextView appearance] setScrollEnabled:TRUE] causing SIGABRT

Discussion in 'iOS Programming' started by moonman239, Dec 14, 2012.

  1. moonman239 macrumors 68000

    Mar 27, 2009
    I just realized I sent my client her app way too soon. I forgot that the simulator threw a SIGABRT error. Luckily, I just sent her another e-mail letting her know that her version would crash. I don't know if she's opened it yet - she hasn't let me know.

    The error dialog seems to suggest that the error was caused by the line of code mentioned in the title of this thread. This is strange, because the app passed the build phase with 4 warnings and no errors. The warnings are irrelevant to the issue.

    I have the base SDK set to 6.0, so no issues there.
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Look up the UIAppearance protocol reference. The appearance method has a return type of id. The compiler doesn't check that an id type has a method for the message. If the type is a defined class, then the compiler does check.

    You should think of id as the type "any object". Since no class has been declared for it, the compiler has no expectation that the object can respond to any message. Therefore, the compiler can perform no compile-time check that the object can respond to a message, and there can be no warning that the object may not respond to the message.

    If the object is given a class name (i.e. a type), then the compiler does know what class the object is expected to be, and thus what message(s) it should respond to. This means the compiler can give warnings about "may not respond to".

Share This Page