GithubHelp home page GithubHelp logo

bad access about toast HOT 7 CLOSED

scalessec avatar scalessec commented on August 23, 2024
bad access

from toast.

Comments (7)

scalessec avatar scalessec commented on August 23, 2024

What iOS version? Are you using ARC? I will address it this evening. Thanks

from toast.

kraag22 avatar kraag22 commented on August 23, 2024

i'm using ARC. iOS version 5.1

from toast.

scalessec avatar scalessec commented on August 23, 2024

I was unable to reproduce this crash. Are you using a navigation controller? I loaded a root controller in a navigation controller, displayed a toast message in the root controller's view, and then pushed a new controller without error (iOS 5.1, ARC, simulator and device). I also simulated a memory warning after pushing the controller to unload the root controller's view and still I didn't experience a crash.

Can you give me more details about your implementation?

from toast.

kraag22 avatar kraag22 commented on August 23, 2024

I'm not using navigation controller. I'm redirecting with

scAppDelegate *appDelegate = (scAppDelegate *)[UIApplication sharedApplication].delegate;
RMMController *controller = [[RMMController alloc] init];

appDelegate.window.rootViewController = controller;
[appDelegate.window addSubview:[controller view]];
[appDelegate.window makeKeyAndVisible];

from toast.

skela avatar skela commented on August 23, 2024

kraag22: a small tip here, but if u were to add the toast to the app delegate's window instead of a view controllers view, u wont have to worry too much. a view controllers view comes and goes, a window lasts forever (almost :P)

from toast.

scalessec avatar scalessec commented on August 23, 2024

@kraag22 , your problem is that you're trying to switch screens without some navigation structure. @skela, generally it's bad practice to add directly to the window unless you really need too, because it defeats the purpose of a view hierarchy. But yes, that would work.

from toast.

skela avatar skela commented on August 23, 2024

@scalessec allthough i agree in general that adding to the window directly has to be done with care, but your Toast classes clean themselves away when done + its the only way to guarantee similar behaviour as in android, i.e. when you change screens, the Toast stays visible.

from toast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.