__weak NSString *strin = [[NSString alloc] initWithFormat:@"hey"] ; NSLog(@"weak %@",strin); //returns weak (null) __weak NSString *strin =@ "hey"; NSLog(@"weak %@",strin); //returns weak hey
What is the difference between both fragments. Why does the second return value when assigning a slide?
This is because @"hey" is a constant string literal that will be forever, while a weak link to the first (highlighted) line is not enough to save it.
@"hey"
Check below and you will receive your answer.
Source: https://habr.com/ru/post/1485802/More articles:Software login by providing credentials - delphi(CSS), how could I make a div so that all the free space is width without a specific value, but there is another div in the same place with a specific one - htmlPerformance Joomla MySQL - performanceDisable the project migration dialog when opening a SharePoint 2010 project - migrationHow to select second page as start page using jQuery datatable - jqueryHow to add list items to another list? - javaRegEx: text immediately after the last open parenthesis - regexhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1485805/subarray-passing-address-to-a-function&usg=ALkJrhi9uOF_V4bf0M6XfIlidrwupGu8WARegEx: A word immediately before the last open parenthesis - regexSitecore with requireSSL for cookies - asp.netAll Articles