passing nsstring from one class to the next

Discussion in 'iOS Programming' started by ethical, Apr 17, 2010.

  1. ethical macrumors 68000

    Dec 22, 2007

    Pretty basic question...sorry for the noobness!

    Say i have an nsstring in ViewController/Class 1, and the value/content of the string is defined by the outcome of a certain event...the user then moves through to ViewController/Class 2 (the next down in a nav based app - from a tableView to a detailView if it makes any difference), how do i carry that string and its value through to the new detailView?

    Sorry for the lack of code and better explanation, im on a train with my iphone and typing this is proving hard enough :p

  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    Define a property on the second view controller and set that before pushing it into the navigation stack.
  3. ethical thread starter macrumors 68000

    Dec 22, 2007
    Great thanks! Will be a while before I can try it out, but thanks for replying so fast.

Share This Page