Comments (5)
There's a line
self.selfReference = nil
which is called when the ActionSheetPicker is dismissed.
If there are other references to self, then dealloc is called and no leaks occur.
Are you actually getting a leak? If so, how? I'm not able to produce a leak, and I get no analyser warnings.
One easy way to test is to place a breakpoint inside the dealloc method.
from actionsheetpicker.
sorry, i mean dealloc method will never calls.
UIView *v = [[[UIView alloc] init] autorelease];
[[[ActionSheetDatePicker alloc] initWithTarget:nil
successAction:nil
cancelAction:nil
origin:v] release];
from actionsheetpicker.
In your example, the ActionSheetTatePicker will deallocate after you call showActionSheetPicker and it is dismissed.
The selfReference is released and set to nil when the ActionSheetPicker is dismissed.
If the ActionSheetPicker is never dismissed (nor presented) then indeed, it won't be released. To avoid this situation, don't create one unless you intend on presenting it.
from actionsheetpicker.
UIView *v = [[[UIView alloc] init] autorelease]; ActionSheetDatePicker *datePicker = [[[ActionSheetDatePicker alloc] initWithTarget:nil successAction:nil cancelAction:nil origin:v]; [datePicker showActionSheetPicker]; [datePicker release];
In this case, the ActionSheetPicker will release soon after being dismissed. Set a breakpoint on the dealloc method for verification.
from actionsheetpicker.
I know.
You need to move line
self.selfReference = self;
to showInView: method
PS: In my example i do not call showAcionSheetPicker, because i want to show you memory leak
from actionsheetpicker.
Related Issues (20)
- Crash when use on iPhone 5S 7.1 HOT 13
- Crash error in iOS7 HOT 4
- Maintance HOT 3
- Layout issue in ActionSheetDistancePicker HOT 1
- Intergrate with multi picker HOT 4
- Issue with iOS 8 beta HOT 18
- Rendering strange problem HOT 4
- It can not work well on IOS8 HOT 1
- Issues with Swift project HOT 2
- Don't show Date Picker on iOS 8 HOT 1
- ActionSheetPicker is not dismissed HOT 1
- size popover HOT 1
- ActionSheetPickerCustomPickerDelegate HOT 2
- iPhone 6 Width is bigger than 320px HOT 1
- Can the datepicker can only show the year and the month? HOT 1
- Toolbar Buttons Tint Color iOS 9 HOT 1
- Toolbar background color HOT 1
- Cannot set picker text color
- Disable iOS UIDatePicker Keyboard
- Distance Picker SIGABRT iOS 7.1 iPad HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actionsheetpicker.