Comments (6)
It also works quite well programmatically, just make sure you declare your KAProgressLabel
as a strong property :
@property (strong,nonatomic) KAProgressLabel * pLabel;
Then just do as you would with any UILabel :
self.pLabel = [[KAProgressLabel alloc] initWithFrame:CGRectMake(20, 40, 100, 100)];
[self.view addSubview:self.pLabel];
from kaprogresslabel.
Thanks for your response.....
I Know, I have done all these and I get a warning.....in the following method..
self.pLabel1.startLabel.text = [NSString stringWithFormat:@"%.f",self.pLabel1.progress*100];
};
The warning is ....
Capturing 'self' strongly in this block is likely to lead to a retain cycle
and also when I go back in my previous controller my app crashes........
Any ideas?
Thanks again
George
from kaprogresslabel.
Just use weakSelf when using self
in a block :
__unsafe_unretained Demo1 * weakSelf = self;
self.pLabel.labelVCBlock = ^(KAProgressLabel *label) {
weakSelf.pLabel.startLabel.text = [NSString stringWithFormat:@"%.f",weakSelf.pLabel.startDegree];
};
You can also use this awesome library to handle retain cycles : https://github.com/jspahrsummers/libextobjc
from kaprogresslabel.
what is Demo1 in following sentence?
__unsafe_unretained Demo1 * weakSelf = self;
On Wed, Mar 18, 2015 at 5:15 PM, Alexis Creuzot [email protected]
wrote:
Just use weakSelf when using self in a block :
__unsafe_unretained Demo1 * weakSelf = self;
self.pLabel.labelVCBlock = ^(KAProgressLabel *label) {
weakSelf.pLabel.startLabel.text = [NSString stringWithFormat:@"%.f",weakSelf.pLabel.startDegree];
};You can also use this awesome library to handle retain cycles :
https://github.com/jspahrsummers/libextobjc—
Reply to this email directly or view it on GitHub
#14 (comment)
.
Γιώργος Ν. Γεράρδης
from kaprogresslabel.
Well this is whatever object holding a reference to the property you need in your block. Usually your UIViewController
.
This is pretty basic stuff, you should maybe try this link for more infos on retain cycles : http://www.cocoawithlove.com/2009/07/rules-to-avoid-retain-cycles.html
I'm closing this issue as it is not about the component anymore. You'll find help on StackOverflow if you need to go deeper on this.
from kaprogresslabel.
OK....
Thank you very very much for your help!
George
On Wed, Mar 18, 2015 at 5:32 PM, Alexis Creuzot [email protected]
wrote:
Well this is whatever object holding a reference to the property you need
in your block. Usually your UIViewController.
This is pretty basic stuff, you should maybe try this link for more infos
on retain cycles :
http://www.cocoawithlove.com/2009/07/rules-to-avoid-retain-cycles.htmlI'm closing this issue as it is not about the component anymore. You'll
find help on StackOverflow if you need to go deeper in this.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
Γιώργος Ν. Γεράρδης
from kaprogresslabel.
Related Issues (20)
- Default roundedCornerWidth doesn't match progressWidth = 4 HOT 14
- Incorrect use of KVO is causing crashes HOT 5
- typo in the readme.md HOT 1
- Three color in progress divide circle in three modes?? HOT 3
- Gradient in Progress Color HOT 5
- Multiple progress view in same circle HOT 2
- Breakpoint with Nan HOT 8
- UIScrollView or TextView scroll event blocks UIView animation HOT 1
- How to use labelVCBlock in swift?? HOT 1
- Animation has not been stopped correctly HOT 1
- Animation in TableView not showing while scrolling HOT 2
- Crashes on Multiple Animations
- Crash in example
- Setting userInteractionEnabled to NO still makes it block views behind it HOT 1
- Progress Label Text change automatically HOT 3
- TPPropertyAnimation RunLoop change causes UI updates in non-main thread HOT 1
- Add tvOS Support HOT 1
- KAProgressLabel.m line 53 -[KAProgressLabel initWithCoder:]
- Getting Error: Value of type 'KAProgressLabel' has no member 'startElipseBorderColor' in Swift 3.3
- Set gradient color HOT 1
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 kaprogresslabel.