Closed omardlhz closed 9 years ago
@omardlhz In order to use the Swift version, you have to import the PopUpViewControllerSwift.Swift file and all the .xibs and make sure that the IBAction for the close button is connected.
See the DemoViewController.swift for how to initialize and use the PopUp in your View Controller. Let me know if the issue still exists.
I am also expereincing the same issue. Everything is fine but when the close button is clicked , the app crashes.
@rizwan95 can you post the crash log?
The error which I get after I press the close button is, Thread 1 : Exc_Bad_Access(Code=EXC_i386_GPFLT) in the app delegate class.
@rizwan95 enable breakpoints exceptions in the exceptions tab and please post the line where the crash occurs.
I'm also interested in a fix of this issue with the close button.
I am having the same issue. Here is the zombie message that I am given: "An Objective-C message was sent to a deallocated 'DealPeel.PopUpViewControllerSwift' object (zombie) at address: 0x126d42880. ". My app name is 'DealPeel'.
Here are the messages is in the console:
@jameswalkerkerr the popUp is deallocated. Are you declaring it as a weak property?
any progress here ?
@break2k can you set a exception breakpoint and post here the code that causes the crash?
pls fix this issue
@einali please see the above answer and post the line that causes the crash using an exception breakpoint.
i still can't get the error log, it's only showing Exc_Bad_Access(Code=EXC_i386_GPFLT), and i've tried adding the exception breakpoint, and it's still like that. Please help :(
We just need #import "NMPopUpView-Swift.h" this class how can i import this ?
@Kecemen if you are using swift classes in your objectivec classes you have to import the -Swift.h generated header in your objective-c classes (only where you want to use your swift classes_. This header is named YourProjectName-Swift.h. For example if your project is named "Kecemen" your swift header will be Kecemen-Swift.h.
Nevermind i decide to use obj-c class and i changed .xib file class. Also, import
PopUpViewController *popViewController = [[PopUpViewController alloc]
initWithNibName:@"PopUpViewController" bundle:nil];
[popViewController setTitle:@"This is a popup view"];
[popViewController showInView:self.view
withImage:[UIImage imageNamed:@"yourImage"]
withMessage:@"Your Message" animated:YES];
this code part.
Popup show working but when i click close app crashed. Than i delete close button action connection than i run. this time, when i click close app not crash but close button do nothing. I cound't find error ?
I fixed problem create UIView and set on .xib view and than set button action
Now popup closed. If anyone want i can send my code.
@Kecemen you can patch the example of the repo and submit a pull request here if you want :-)
I created pull request but i don't know how can i download my codes.
So.... What is the solution in the Swift language?
@Brain2success a new version will be available soon, with cocoapods support and it will be only, which will fix this issue. Meanwhile just disconnect the close action from the .xibs and add it again.
Well tanks for the quick response! Instead of disconnect and add it again, I added a new UIButton and connected to the swift file. Just with a simple println("test"). But it also resolve in the same error.
@Brain2success what error are you getting? I am unable to reproduce this. If you can put a debug breakpoint and send me the line that crashes it will be great. Also if you are able to reproduce this issue in a test product and upload it here, you can give me access and I will be able to see what is going wrong.
https://github.com/Brain2success/popUpView.git here you find a simple test product I even added a extra button like i did in the original.
@psy2k did you tried the link I send you? And are you able to reproduce the error?
@Brain2success the problem is that you declare the popUpViewController property in the method where you calling it. That causes it to be released after presenting, so the close action is sent to a deallocated instance which causes a crash. Declare the property in the class variables from where you are going to call the popup var popViewController = PopUpViewControllerSwift(nibName: "PopUpViewController_iPad", bundle: nil)
and in the method. If your viewcontroller is written in ObjC declare the popup property in the interface with a strong reference.
@Brain2success I will commit the fix to your repository so anyone here can see whats changed (You have to give me push access to the repo for that). The correct implementation is also available in the examples provided by this repo.
Hello,
I think you should have access to the files now. Is that correct?
Brain2Success
On wo, sep. 9, 2015 at 11:33 p.m., psy2k/NMPopUpView reply@reply.github.com wrote:
Closed #9https://github.com/psy2k/NMPopUpView/issues/9.
— Reply to this email directly or view it on GitHubhttps://github.com/psy2k/NMPopUpView/issues/9#event-405320843.
@Brain2success I've pushed the fix https://github.com/Brain2success/popUpView/commit/8a613e1d1db8d38c3b4d0dade7a9840710995f33
@Kecemen please send ur code my mail id is saikrishna.tadavarthy@gmail.com
@sai487 you can subclass the popup so you can override the close function and add custom code for it.
I've read all the issues and I still cant manage to make the close button work. I imported the PopUpViewController.xib and the PopUpViewControllerSwift.swift files, do I need to import any other files?